()
| 32 | } |
| 33 | |
| 34 | function checkStackCookie() { |
| 35 | #if !MINIMAL_RUNTIME |
| 36 | if (ABORT) return; |
| 37 | #endif |
| 38 | var max = _emscripten_stack_get_end(); |
| 39 | #if RUNTIME_DEBUG >= 2 |
| 40 | dbg(`checkStackCookie: ${ptrToString(max)}`); |
| 41 | #endif |
| 42 | // See writeStackCookie(). |
| 43 | if (max == 0) { |
| 44 | max += 4; |
| 45 | } |
| 46 | var cookie1 = {{{ makeGetValue('max', 0, 'u32') }}}; |
| 47 | var cookie2 = {{{ makeGetValue('max', 4, 'u32') }}}; |
| 48 | if (cookie1 != 0x02135467 || cookie2 != 0x89BACDFE) { |
| 49 | abort(`Stack overflow! Stack cookie has been overwritten at ${ptrToString(max)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${ptrToString(cookie2)} ${ptrToString(cookie1)}`); |
no test coverage detected