aboutsummaryrefslogtreecommitdiffstats
path: root/lib/reltool/src/reltool_utils.erl
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2013-04-09 22:20:00 +0200
committerFredrik Gustafsson <[email protected]>2013-04-19 11:47:00 +0200
commit8aa46fd40d759de2d6a13fbafb5e88cdf1047220 (patch)
treefe67482bb0901c12b94f4db547afe20a846127ef /lib/reltool/src/reltool_utils.erl
parent4e220f07593c80ba20c6ce968ae608f5363ef75b (diff)
downloadotp-8aa46fd40d759de2d6a13fbafb5e88cdf1047220.tar.gz
otp-8aa46fd40d759de2d6a13fbafb5e88cdf1047220.tar.bz2
otp-8aa46fd40d759de2d6a13fbafb5e88cdf1047220.zip
Use a set to store ref registers in beam_receive
In some circumstances, as when inlining code, when some optimization passes are disabled or with hand-written but semantically correct Core Erlang or BEAM assembly, a fresh reference may be live in more than one register: ... {allocate_zero,2,2}. ... {call_ext,0,{extfunc,erlang,make_ref,0}}. % Ref in [x0] ... {move,{x,0},{y,0}}. % Ref in [x0,y0] {move,{y,1},{x,0}}. % Ref in [y0] ... {move,{y,0},{x,0}}. % Ref in [x0,y0] {move,{x,0},{y,1}}. % Ref in [x0,y0,y1] {label,5}. {loop_rec,{f,6},{x,0}}. % Ref in [y0,y1] ... {loop_rec_end,{f,5}}. {label,6}. {wait,{f,5}}. ... Pass beam_receive expects a single live register for the ref when it encounters the loop_rec instruction and crashes with the following reason: $ erlc t.S ... crash reason: {{case_clause, {'EXIT', {{case_clause,[{y,1},{y,0}]}, [{beam_receive,opt_recv,5, [{file,"beam_receive.erl"},{line,154}]}, ...]}}}, ...} This commit teaches beam_receive how to use a set of registers instead of a single one when tracking fresh references, thus avoiding the crash.
Diffstat (limited to 'lib/reltool/src/reltool_utils.erl')
0 files changed, 0 insertions, 0 deletions