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
// Initializes the stack cookie. Called at the startup of main and at the startup of each thread in pthreads mode.
functionwriteStackCookie(){
varmax=_emscripten_stack_get_end();
#if ASSERTIONS
assert((max&3)==0);
#endif
// The stack grows downwards
HEAPU32[(max>>2)+1]=0x2135467;
HEAPU32[(max>>2)+2]=0x89BACDFE;
#if !USE_ASAN&&!SAFE_HEAP// ASan and SAFE_HEAP check address 0 themselves
// Also test the global address 0 for integrity.
HEAP32[0]=0x63736d65;/* 'emsc' */
#endif
}
functioncheckStackCookie(){
#if !MINIMAL_RUNTIME
if(ABORT)return;
#endif
varmax=_emscripten_stack_get_end();
varcookie1=HEAPU32[(max>>2)+1];
varcookie2=HEAPU32[(max>>2)+2];
if(cookie1!=0x2135467||cookie2!=0x89BACDFE){
abort('Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+cookie2.toString(16)+' '+cookie1.toString(16));
}
#if !USE_ASAN&&!SAFE_HEAP// ASan and SAFE_HEAP check address 0 themselves
// Also test the global address 0 for integrity.
if(HEAP32[0]!==0x63736d65/* 'emsc' */)abort('Runtime error: The application has corrupted its heap memory area (address zero)!');