Skip to content

Commit ffb13fe

Browse files
committed
minus one
1 parent b74634b commit ffb13fe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

emcc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2270,7 +2270,7 @@ def check_memory_setting(setting):
22702270

22712271
# We start our global data after the shadow memory.
22722272
# We don't need to worry about alignment here. wasm-ld will take care of that.
2273-
settings.GLOBAL_BASE = shadow_size + 1
2273+
settings.GLOBAL_BASE = shadow_size
22742274

22752275
if not settings.ALLOW_MEMORY_GROWTH:
22762276
settings.INITIAL_MEMORY = total_mem

system/lib/compiler-rt/lib/asan/asan_emscripten.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ void InitializeShadowMemory() {
2424
// Assert that the shadow region is large enough. We don't want to start
2525
// running into the static data region which starts right after the shadow
2626
// region.
27-
uptr max_address = __builtin_wasm_memory_size(0) * WASM_PAGE_SIZE;
27+
uptr max_address = (__builtin_wasm_memory_size(0) * WASM_PAGE_SIZE) - 1;
2828
uptr max_shadow_address = MEM_TO_SHADOW(max_address);
2929
// TODO(sbc): In the growable memory case we should really be checking this
3030
// every time we grow.

0 commit comments

Comments
 (0)