Skip to content

Commit 0296f5b

Browse files
committed
minus one
1 parent b74634b commit 0296f5b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

emcc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2188,8 +2188,8 @@ def check_memory_setting(setting):
21882188
# Increase the minimum memory requirements to account for extra memory
21892189
# that the sanitizers might need (in addition to the shadow memory
21902190
# requirements handled below).
2191-
# These values are designed be over-estimate the actual requirements and
2192-
# based on experimentation with different tests/programs under asan and
2191+
# These values are designed be an over-estimate of the actual requirements and
2192+
# are based on experimentation with different tests/programs under asan and
21932193
# lsan.
21942194
settings.INITIAL_MEMORY += 50 * 1024 * 1024
21952195
if settings.USE_PTHREADS:
@@ -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)