aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2018-03-19 14:40:32 +0100
committerBjörn Gustavsson <[email protected]>2018-03-19 14:47:48 +0100
commit4332bcdc9f6dd1b4c390a50df07b7e8ebf536f88 (patch)
treef982e652a9a60907529937ef66c26e6619853cfd /lib/compiler/src
parent6751506b67e3ba6f4ce9eacd040ea269fca643fd (diff)
downloadotp-4332bcdc9f6dd1b4c390a50df07b7e8ebf536f88.tar.gz
otp-4332bcdc9f6dd1b4c390a50df07b7e8ebf536f88.tar.bz2
otp-4332bcdc9f6dd1b4c390a50df07b7e8ebf536f88.zip
core_parse: Fix handling of negative sizes in binaries
A literal negative size in binary construction would cause a crash.
Diffstat (limited to 'lib/compiler/src')
-rw-r--r--lib/compiler/src/core_parse.yrl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compiler/src/core_parse.yrl b/lib/compiler/src/core_parse.yrl
index 79a7cccd98..85444023c6 100644
--- a/lib/compiler/src/core_parse.yrl
+++ b/lib/compiler/src/core_parse.yrl
@@ -496,7 +496,7 @@ make_lit_bin(Acc, [#c_bitstr{val=I0,size=Sz0,unit=U0,type=Type0,flags=F0}|T]) ->
throw(impossible)
end,
if
- Sz =< 8, T =:= [] ->
+ 0 =< Sz, Sz =< 8, T =:= [] ->
<<Acc/binary,I:Sz>>;
Sz =:= 8 ->
make_lit_bin(<<Acc/binary,I:8>>, T);