aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_block.erl
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2013-11-19 18:15:10 +0100
committerBjörn Gustavsson <[email protected]>2013-12-13 12:52:06 +0100
commit4df9a5ab0da9fed4ff67f99fdb191b56780bec0b (patch)
treedd27ba5eed0bf6f1b6adada88057077a1894302a /lib/compiler/src/beam_block.erl
parent51c7e590e470cb2aa8d09ac8f56a659e272d88b4 (diff)
downloadotp-4df9a5ab0da9fed4ff67f99fdb191b56780bec0b.tar.gz
otp-4df9a5ab0da9fed4ff67f99fdb191b56780bec0b.tar.bz2
otp-4df9a5ab0da9fed4ff67f99fdb191b56780bec0b.zip
Properly collect allocate_zero instructions in beam_block
If an allocate_zero instruction is fed to beam_block and the beam_type pass is not used afterwards (e.g. with erlc +no_topt), the 'no_opt' atom will be rejected by beam_flatten.
Diffstat (limited to 'lib/compiler/src/beam_block.erl')
-rw-r--r--lib/compiler/src/beam_block.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compiler/src/beam_block.erl b/lib/compiler/src/beam_block.erl
index ea984a6afb..5d96b51bff 100644
--- a/lib/compiler/src/beam_block.erl
+++ b/lib/compiler/src/beam_block.erl
@@ -124,7 +124,7 @@ collect_block(Is) ->
collect_block(Is, []).
collect_block([{allocate_zero,Ns,R},{test_heap,Nh,R}|Is], Acc) ->
- collect_block(Is, [{set,[],[],{alloc,R,{no_opt,Ns,Nh,[]}}}|Acc]);
+ collect_block(Is, [{set,[],[],{alloc,R,{zero,Ns,Nh,[]}}}|Acc]);
collect_block([I|Is]=Is0, Acc) ->
case collect(I) of
error -> {reverse(Acc),Is0};