aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2015-11-16 15:39:02 +0100
committerSverker Eriksson <[email protected]>2015-11-16 15:39:02 +0100
commit1f61a1f613486d4909f1c43b0d7ca46767e88e23 (patch)
treeeef0c3c37c5b61b013ccda2d4ec6a65da0b41791 /erts/emulator
parent9bdd69a560765931cdd5dac50c8c8389263a2f6b (diff)
parentfd1e6b2b2623395512ea0450c3b4e656cb354f42 (diff)
downloadotp-1f61a1f613486d4909f1c43b0d7ca46767e88e23.tar.gz
otp-1f61a1f613486d4909f1c43b0d7ca46767e88e23.tar.bz2
otp-1f61a1f613486d4909f1c43b0d7ca46767e88e23.zip
Merge branch 'sverk/binary-split-bug'
* sverk/binary-split-bug: stdlib: Fix bug in binary:split for empty binary
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/erl_bif_binary.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_bif_binary.c b/erts/emulator/beam/erl_bif_binary.c
index b9640e211d..aec72bd61a 100644
--- a/erts/emulator/beam/erl_bif_binary.c
+++ b/erts/emulator/beam/erl_bif_binary.c
@@ -1614,6 +1614,10 @@ static Eterm do_split_not_found_result(Process *p, Eterm subject, BinaryFindStat
Eterm *hp;
Eterm ret;
+ if (bfs->flags & (BINARY_SPLIT_TRIM | BINARY_SPLIT_TRIM_ALL)
+ && binary_size(subject) == 0) {
+ return NIL;
+ }
hp = HAlloc(p, 2);
ret = CONS(hp, subject, NIL);