You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix the stack pointer in wasm backend+threads mode (#8811)
* Set STACK_MAX properly in the wasm backend, it should point to the lowest address since the wasm stack grows downwards.
* Fix the stack overflow test to work with the wasm backend.
abort('Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x02135467, but received 0x'+HEAPU32[(STACK_MAX>>2)-2].toString(16)+' '+HEAPU32[(STACK_MAX>>2)-1].toString(16));
16
+
#if WASM_BACKEND
17
+
varcookie1=HEAPU32[(STACK_MAX>>2)+1];
18
+
varcookie2=HEAPU32[(STACK_MAX>>2)+2];
19
+
#else
20
+
varcookie1=HEAPU32[(STACK_MAX>>2)-1];
21
+
varcookie2=HEAPU32[(STACK_MAX>>2)-2];
22
+
#endif
23
+
if(cookie1!=0x02135467||cookie2!=0x89BACDFE){
24
+
abort('Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x02135467, but received 0x'+cookie2.toString(16)+' '+cookie1.toString(16));
12
25
}
13
26
// Also test the global address 0 for integrity.
14
27
if(HEAP32[0]!==0x63736d65/* 'emsc' */)abort('Runtime error: The application has corrupted its heap memory area (address zero)!');
0 commit comments