aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2015-08-28 18:08:04 +0200
committerSverker Eriksson <[email protected]>2015-08-28 19:02:38 +0200
commit90e0bad70affc23228e3d11d1131aba615895dd5 (patch)
tree22c738ff90cab95ff02d1753f6d21fbef4761df0 /erts/emulator
parentc0694699e20ba9985d842c0efaeefbc457bc518c (diff)
downloadotp-90e0bad70affc23228e3d11d1131aba615895dd5.tar.gz
otp-90e0bad70affc23228e3d11d1131aba615895dd5.tar.bz2
otp-90e0bad70affc23228e3d11d1131aba615895dd5.zip
erts: Fix hipe bug for maps:merge/2
Add forgotten HIPE_WRAPPER_BIF_DISABLE_GC which could lead to stack-heap overrun if unlucky with the yielding during maps:merge when called by native hipe code.
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/erl_map.c5
-rw-r--r--erts/emulator/hipe/hipe_bif_list.m41
2 files changed, 6 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_map.c b/erts/emulator/beam/erl_map.c
index a91e36e3c5..ff2a355309 100644
--- a/erts/emulator/beam/erl_map.c
+++ b/erts/emulator/beam/erl_map.c
@@ -32,7 +32,9 @@
#include "global.h"
#include "erl_process.h"
#include "error.h"
+#define ERL_WANT_HIPE_BIF_WRAPPER__
#include "bif.h"
+#undef ERL_WANT_HIPE_BIF_WRAPPER__
#include "erl_binary.h"
#include "erl_map.h"
@@ -952,8 +954,11 @@ BIF_RETTYPE maps_keys_1(BIF_ALIST_1) {
BIF_P->fvalue = BIF_ARG_1;
BIF_ERROR(BIF_P, BADMAP);
}
+
/* maps:merge/2 */
+HIPE_WRAPPER_BIF_DISABLE_GC(maps_merge, 2)
+
BIF_RETTYPE maps_merge_2(BIF_ALIST_2) {
if (is_flatmap(BIF_ARG_1)) {
if (is_flatmap(BIF_ARG_2)) {
diff --git a/erts/emulator/hipe/hipe_bif_list.m4 b/erts/emulator/hipe/hipe_bif_list.m4
index 1d36ccdb5d..6aa0c9a32e 100644
--- a/erts/emulator/hipe/hipe_bif_list.m4
+++ b/erts/emulator/hipe/hipe_bif_list.m4
@@ -284,6 +284,7 @@ $1, list_to_bitstring_1, hipe_wrapper_$1,
$1, send_2, hipe_wrapper_$1,
$1, send_3, hipe_wrapper_$1,
$1, ebif_bang_2, hipe_wrapper_$1,
+$1, maps_merge_2, hipe_wrapper_$1,
$1)')
define(BIF_LIST,`standard_bif_interface_$3(nbif_$4, CFUN($4))')