aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-02-17 14:14:43 +0100
committerBjörn Gustavsson <[email protected]>2011-08-16 08:58:49 +0200
commit87e639bef1cbe37f63fcd376ec17dc8fca77fe3f (patch)
treea6f1be537f1b27cd5de3e50ad293fc6b3181a5d8 /lib/hipe
parentc846bf3f57937da34589c9071291a3be5ad0c4bc (diff)
downloadotp-87e639bef1cbe37f63fcd376ec17dc8fca77fe3f.tar.gz
otp-87e639bef1cbe37f63fcd376ec17dc8fca77fe3f.tar.bz2
otp-87e639bef1cbe37f63fcd376ec17dc8fca77fe3f.zip
Include location information for line instructions in BEAM files
Diffstat (limited to 'lib/hipe')
-rw-r--r--lib/hipe/icode/hipe_beam_to_icode.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/hipe/icode/hipe_beam_to_icode.erl b/lib/hipe/icode/hipe_beam_to_icode.erl
index 8254d71965..f557d3419e 100644
--- a/lib/hipe/icode/hipe_beam_to_icode.erl
+++ b/lib/hipe/icode/hipe_beam_to_icode.erl
@@ -281,10 +281,14 @@ needs_redtest(Leafness) ->
%%-----------------------------------------------------------------------
%%--- label & func_info combo ---
+trans_fun([{label,_}=F,{func_info,_,_,_}=FI|Instructions], Env) ->
+ %% Handle old code without a line instruction.
+ trans_fun([F,{line,[]},FI|Instructions], Env);
trans_fun([{label,B},{label,_},
{func_info,M,F,A},{label,L}|Instructions], Env) ->
trans_fun([{label,B},{func_info,M,F,A},{label,L}|Instructions], Env);
trans_fun([{label,B},
+ {line,_},
{func_info,{atom,_M},{atom,_F},_A},
{label,L}|Instructions], Env) ->
%% Emit code to handle function_clause errors. The BEAM test instructions
@@ -1874,6 +1878,8 @@ patch_make_funs([], FunIndex, Acc) ->
find_mfa([{label,_}|Code]) ->
find_mfa(Code);
+find_mfa([{line,_}|Code]) ->
+ find_mfa(Code);
find_mfa([{func_info,{atom,M},{atom,F},A}|_])
when is_atom(M), is_atom(F), is_integer(A), 0 =< A, A =< 255 ->
{M, F, A}.