aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-05-08 16:13:09 +0200
committerBjörn-Egil Dahlberg <[email protected]>2015-05-08 16:13:09 +0200
commitb51bbf8b8a06e7bf18e0b837f50dad4a66a0fca7 (patch)
tree73217b48360797480834555b323e6278c97d81eb /erts/emulator/beam
parentbeb883ed443dfeb41f239363f36c511dd43c7eec (diff)
downloadotp-b51bbf8b8a06e7bf18e0b837f50dad4a66a0fca7.tar.gz
otp-b51bbf8b8a06e7bf18e0b837f50dad4a66a0fca7.tar.bz2
otp-b51bbf8b8a06e7bf18e0b837f50dad4a66a0fca7.zip
erts: Make hashmap_get halfword safe
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/erl_db_util.c2
-rw-r--r--erts/emulator/beam/erl_map.c7
2 files changed, 4 insertions, 5 deletions
diff --git a/erts/emulator/beam/erl_db_util.c b/erts/emulator/beam/erl_db_util.c
index a75267ca97..c6c3c55a7e 100644
--- a/erts/emulator/beam/erl_db_util.c
+++ b/erts/emulator/beam/erl_db_util.c
@@ -2039,7 +2039,7 @@ restart:
break;
case matchKey:
t = (Eterm) *pc++;
- tp = erts_maps_get_rel(t, make_flatmap_rel(ep, base), base);
+ tp = erts_maps_get_rel(t, make_boxed_rel(ep, base), base);
if (!tp) {
FAIL();
}
diff --git a/erts/emulator/beam/erl_map.c b/erts/emulator/beam/erl_map.c
index bb2a2bcdf9..57f06c369c 100644
--- a/erts/emulator/beam/erl_map.c
+++ b/erts/emulator/beam/erl_map.c
@@ -1884,7 +1884,7 @@ erts_hashmap_get(Uint32 hx, Eterm key, Eterm node)
UseTmpHeapNoproc(2);
ASSERT(is_boxed(node));
- ptr = boxed_val(node);
+ ptr = boxed_val_rel(node, map_base);
hdr = *ptr;
ASSERT(is_header(hdr));
ASSERT(is_hashmap_header_head(hdr));
@@ -1905,8 +1905,7 @@ erts_hashmap_get(Uint32 hx, Eterm key, Eterm node)
node = ptr[ix+1];
if (is_list(node)) { /* LEAF NODE [K|V] */
- ptr = list_val(node);
-
+ ptr = list_val_rel(node,map_base);
res = eq_rel(CAR(ptr), map_base, key, NULL) ? &(CDR(ptr)) : NULL;
break;
}
@@ -1914,7 +1913,7 @@ erts_hashmap_get(Uint32 hx, Eterm key, Eterm node)
hx = hashmap_shift_hash(th,hx,lvl,key);
ASSERT(is_boxed(node));
- ptr = boxed_val(node);
+ ptr = boxed_val_rel(node, map_base);
hdr = *ptr;
ASSERT(is_header(hdr));
ASSERT(!is_hashmap_header_head(hdr));