aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_map.c
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/erl_map.c
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/erl_map.c')
-rw-r--r--erts/emulator/beam/erl_map.c7
1 files changed, 3 insertions, 4 deletions
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));