diff options
author | Björn Gustavsson <[email protected]> | 2016-04-07 12:43:06 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-04-08 10:28:42 +0200 |
commit | ab03678e87732407625150c202e177a85a025beb (patch) | |
tree | 881f543c0f7ca0cb099fe3eec71a7b37b0bf27be /lib/compiler/src/beam_block.erl | |
parent | 3c0f98c1b0e74eb58a4e4e82a3ec89dc7ecdb579 (diff) | |
download | otp-ab03678e87732407625150c202e177a85a025beb.tar.gz otp-ab03678e87732407625150c202e177a85a025beb.tar.bz2 otp-ab03678e87732407625150c202e177a85a025beb.zip |
Remove unreachable code after 'raise' instructions
Remove the unreachable instructions after a 'raise' instruction
(e.g. a 'jump' or 'deallocate', 'return') to decrease code size.
Diffstat (limited to 'lib/compiler/src/beam_block.erl')
-rw-r--r-- | lib/compiler/src/beam_block.erl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/compiler/src/beam_block.erl b/lib/compiler/src/beam_block.erl index d1052303e0..429b1aa010 100644 --- a/lib/compiler/src/beam_block.erl +++ b/lib/compiler/src/beam_block.erl @@ -88,7 +88,9 @@ collect_block([I|Is]=Is0, Acc) -> case collect(I) of error -> {reverse(Acc),Is0}; Instr -> collect_block(Is, [Instr|Acc]) - end. + end; +collect_block([], Acc) -> + {reverse(Acc),[]}. collect({allocate,N,R}) -> {set,[],[],{alloc,R,{nozero,N,0,[]}}}; collect({allocate_zero,N,R}) -> {set,[],[],{alloc,R,{zero,N,0,[]}}}; |