From 4332bcdc9f6dd1b4c390a50df07b7e8ebf536f88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Mon, 19 Mar 2018 14:40:32 +0100 Subject: core_parse: Fix handling of negative sizes in binaries A literal negative size in binary construction would cause a crash. --- lib/compiler/src/core_parse.yrl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/compiler/src') 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 =:= [] -> <>; Sz =:= 8 -> make_lit_bin(<>, T); -- cgit v1.2.3