aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/binary.c
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2018-02-19 15:36:40 +0100
committerJohn Högberg <[email protected]>2018-02-19 15:36:40 +0100
commitd19fc31cba8670c2fc09a7911b4e329052a3a23d (patch)
tree84fd21890a8786cc176db71a8c517e5a86107933 /erts/emulator/beam/binary.c
parent474b2ef465cddf41d311464c48bf99dd007f270f (diff)
parent443fbb24248516523512c9bc591252eafafd1311 (diff)
downloadotp-d19fc31cba8670c2fc09a7911b4e329052a3a23d.tar.gz
otp-d19fc31cba8670c2fc09a7911b4e329052a3a23d.tar.bz2
otp-d19fc31cba8670c2fc09a7911b4e329052a3a23d.zip
Merge branch 'john/erts/fix-iolist-bitstring-badarg/OTP-14926' into maint
Diffstat (limited to 'erts/emulator/beam/binary.c')
-rw-r--r--erts/emulator/beam/binary.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/erts/emulator/beam/binary.c b/erts/emulator/beam/binary.c
index d4db1a4188..95d324d2c1 100644
--- a/erts/emulator/beam/binary.c
+++ b/erts/emulator/beam/binary.c
@@ -953,7 +953,10 @@ HIPE_WRAPPER_BIF_DISABLE_GC(iolist_to_binary, 1)
BIF_RETTYPE iolist_to_binary_1(BIF_ALIST_1)
{
if (is_binary(BIF_ARG_1)) {
- BIF_RET(BIF_ARG_1);
+ if (binary_bitsize(BIF_ARG_1) == 0) {
+ BIF_RET(BIF_ARG_1);
+ }
+ BIF_ERROR(BIF_P, BADARG);
}
return erts_list_to_binary_bif(BIF_P, BIF_ARG_1, bif_export[BIF_iolist_to_binary_1]);
}