aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/v3_codegen.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2010-09-23 09:35:34 +0200
committerBjörn Gustavsson <[email protected]>2010-09-23 09:35:34 +0200
commitd0c538e3dd5072ad0227553f5dd7dcdc2e6c3288 (patch)
tree9953e399c5e437247350fcfcc4d8b743169f49ea /lib/compiler/src/v3_codegen.erl
parentdc7d2319691fa599717c066460cce53ce97b6b18 (diff)
downloadotp-d0c538e3dd5072ad0227553f5dd7dcdc2e6c3288.tar.gz
otp-d0c538e3dd5072ad0227553f5dd7dcdc2e6c3288.tar.bz2
otp-d0c538e3dd5072ad0227553f5dd7dcdc2e6c3288.zip
Fix compiler crash when constructing zero-size binary segments
Code such as foo(A) -> <<A:0>>. would cause a compiler crash.
Diffstat (limited to 'lib/compiler/src/v3_codegen.erl')
-rw-r--r--lib/compiler/src/v3_codegen.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/compiler/src/v3_codegen.erl b/lib/compiler/src/v3_codegen.erl
index 948937c438..77da6c8d00 100644
--- a/lib/compiler/src/v3_codegen.erl
+++ b/lib/compiler/src/v3_codegen.erl
@@ -1523,7 +1523,9 @@ cg_binary_size_1([], Bits, Acc) ->
[{1,_}|_] ->
{bs_init_bits,cg_binary_bytes_to_bits(Sizes, [])};
[{8,_}|_] ->
- {bs_init2,[E || {8,E} <- Sizes]}
+ {bs_init2,[E || {8,E} <- Sizes]};
+ [] ->
+ {bs_init_bits,[]}
end.
cg_binary_size_2({integer,N}, U, _, Next, Bits, Acc) ->