diff options
author | Sverker Eriksson <[email protected]> | 2017-12-20 17:18:31 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2018-01-03 16:43:31 +0100 |
commit | 3d21f793538927ae88f78504a11dd898e8ca1a7a (patch) | |
tree | 84e0a989a53636e3a3f3bc2b84332d4318a3266d /erts/emulator/hipe/hipe_native_bif.c | |
parent | 44b09e036b31b29dddc3b178e8f6b9fc96a9a874 (diff) | |
download | otp-3d21f793538927ae88f78504a11dd898e8ca1a7a.tar.gz otp-3d21f793538927ae88f78504a11dd898e8ca1a7a.tar.bz2 otp-3d21f793538927ae88f78504a11dd898e8ca1a7a.zip |
Fix bug in hipe primop bs_put_utf8
by preventing it from doing GC, which generated code relies on.
Diffstat (limited to 'erts/emulator/hipe/hipe_native_bif.c')
-rw-r--r-- | erts/emulator/hipe/hipe_native_bif.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/erts/emulator/hipe/hipe_native_bif.c b/erts/emulator/hipe/hipe_native_bif.c index e1c22701d0..6ab7a9e1de 100644 --- a/erts/emulator/hipe/hipe_native_bif.c +++ b/erts/emulator/hipe/hipe_native_bif.c @@ -398,12 +398,8 @@ Eterm hipe_bs_utf8_size(Eterm arg) return make_small(4); } -BIF_RETTYPE nbif_impl_hipe_bs_put_utf8(NBIF_ALIST_3) +Eterm hipe_bs_put_utf8(Process* p, Eterm arg, byte* base, Uint offset) { - Process* p = BIF_P; - Eterm arg = BIF_ARG_1; - byte* base = (byte*) BIF_ARG_2; - Uint offset = (Uint) BIF_ARG_3; byte *save_bin_buf; Uint save_bin_offset; int res; @@ -419,7 +415,8 @@ BIF_RETTYPE nbif_impl_hipe_bs_put_utf8(NBIF_ALIST_3) erts_current_bin = save_bin_buf; erts_bin_offset = save_bin_offset; if (res == 0) - BIF_ERROR(p, BADARG); + return 0; + ASSERT(new_offset != 0); return new_offset; } |