[erlang-questions] bug: R12B-0 Hipe compile error

Mikael Pettersson mikpe@REDACTED
Fri Dec 28 15:35:20 CET 2007


Eranga Udesh writes:
 > Attached is the best I can narrow it down. Any part removed from that code
 > snippet, the error disappears. Hope this will help.

It does help, thanks.

Per Gustafsson of the HiPE group has fixed the bug.
Below you'll find a backported & tested patch for R12B-0.

/Mikael

--- otp_src_R12B-0/lib/hipe/icode/hipe_beam_to_icode.erl.~1~	2007-11-26 19:58:35.000000000 +0100
+++ otp_src_R12B-0/lib/hipe/icode/hipe_beam_to_icode.erl	2007-12-28 15:31:36.000000000 +0100
@@ -383,14 +383,14 @@ trans_fun([{bif,BifName,{f,Lbl},[_,_] = 
 trans_fun([{allocate,StackSlots,_}|Instructions], Env) ->
   trans_allocate(StackSlots) ++ trans_fun(Instructions,Env);
 %%--- allocate_heap --- IGNORED ON PURPOSE
-trans_fun([{allocate_heap,_,_,_}|Instructions], Env) ->
-  trans_fun(Instructions,Env);
+trans_fun([{allocate_heap,StackSlots,_,_}|Instructions], Env) ->
+  trans_allocate(StackSlots) ++ trans_fun(Instructions,Env);
 %%--- allocate_zero
 trans_fun([{allocate_zero,StackSlots,_}|Instructions], Env) ->
   trans_allocate(StackSlots) ++ trans_fun(Instructions,Env);
 %%--- allocate_heap_zero --- IGNORED ON PURPOSE
-trans_fun([{allocate_heap_zero,_,_,_}|Instructions], Env) ->
-  trans_fun(Instructions,Env);
+trans_fun([{allocate_heap_zero,StackSlots,_,_}|Instructions], Env) ->
+  trans_allocate(StackSlots) ++ trans_fun(Instructions,Env);
 %%--- test_heap --- IGNORED ON PURPOSE
 trans_fun([{test_heap,_,_}|Instructions], Env) ->
   trans_fun(Instructions,Env);



More information about the erlang-questions mailing list