diff --git a/www/common/onlyoffice/x2t/x2t.js b/www/common/onlyoffice/x2t/x2t.js index c2f1d9da5..eaae20905 100644 --- a/www/common/onlyoffice/x2t/x2t.js +++ b/www/common/onlyoffice/x2t/x2t.js @@ -60,6 +60,9 @@ ENVIRONMENT_HAS_NODE = typeof process === 'object' && typeof process.versions == ENVIRONMENT_IS_NODE = ENVIRONMENT_HAS_NODE && !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_WORKER; ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER; +if (Module['ENVIRONMENT']) { + throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)'); +} // Three configurations we can be running in: @@ -293,6 +296,7 @@ if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { setWindowTitle = function(title) { document.title = title }; } else { + throw new Error('environment detection error'); } if (ENVIRONMENT_HAS_NODE) { @@ -322,11 +326,30 @@ moduleOverrides = null; // to the proper local x. This has two benefits: first, we only emit it if it is // expected to arrive, and second, by using a local everywhere else that can be // minified. -if (Module['arguments']) arguments_ = Module['arguments']; -if (Module['thisProgram']) thisProgram = Module['thisProgram']; -if (Module['quit']) quit_ = Module['quit']; +if (Module['arguments']) arguments_ = Module['arguments'];if (!Object.getOwnPropertyDescriptor(Module, 'arguments')) Object.defineProperty(Module, 'arguments', { configurable: true, get: function() { abort('Module.arguments has been replaced with plain arguments_') } }); +if (Module['thisProgram']) thisProgram = Module['thisProgram'];if (!Object.getOwnPropertyDescriptor(Module, 'thisProgram')) Object.defineProperty(Module, 'thisProgram', { configurable: true, get: function() { abort('Module.thisProgram has been replaced with plain thisProgram') } }); +if (Module['quit']) quit_ = Module['quit'];if (!Object.getOwnPropertyDescriptor(Module, 'quit')) Object.defineProperty(Module, 'quit', { configurable: true, get: function() { abort('Module.quit has been replaced with plain quit_') } }); // perform assertions in shell.js after we set up out() and err(), as otherwise if an assertion fails it cannot print the message +// Assertions on removed incoming Module JS APIs. +assert(typeof Module['memoryInitializerPrefixURL'] === 'undefined', 'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'); +assert(typeof Module['pthreadMainPrefixURL'] === 'undefined', 'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'); +assert(typeof Module['cdInitializerPrefixURL'] === 'undefined', 'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'); +assert(typeof Module['filePackagePrefixURL'] === 'undefined', 'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'); +assert(typeof Module['read'] === 'undefined', 'Module.read option was removed (modify read_ in JS)'); +assert(typeof Module['readAsync'] === 'undefined', 'Module.readAsync option was removed (modify readAsync in JS)'); +assert(typeof Module['readBinary'] === 'undefined', 'Module.readBinary option was removed (modify readBinary in JS)'); +assert(typeof Module['setWindowTitle'] === 'undefined', 'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'); +if (!Object.getOwnPropertyDescriptor(Module, 'read')) Object.defineProperty(Module, 'read', { configurable: true, get: function() { abort('Module.read has been replaced with plain read_') } }); +if (!Object.getOwnPropertyDescriptor(Module, 'readAsync')) Object.defineProperty(Module, 'readAsync', { configurable: true, get: function() { abort('Module.readAsync has been replaced with plain readAsync') } }); +if (!Object.getOwnPropertyDescriptor(Module, 'readBinary')) Object.defineProperty(Module, 'readBinary', { configurable: true, get: function() { abort('Module.readBinary has been replaced with plain readBinary') } }); +// TODO: add when SDL2 is fixed if (!Object.getOwnPropertyDescriptor(Module, 'setWindowTitle')) Object.defineProperty(Module, 'setWindowTitle', { configurable: true, get: function() { abort('Module.setWindowTitle has been replaced with plain setWindowTitle') } }); +var IDBFS = 'IDBFS is no longer included by default; build with -lidbfs.js'; +var PROXYFS = 'PROXYFS is no longer included by default; build with -lproxyfs.js'; +var WORKERFS = 'WORKERFS is no longer included by default; build with -lworkerfs.js'; + + +assert(ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER || ENVIRONMENT_IS_NODE, 'Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)'); // TODO remove when SDL2 is fixed (also see above) @@ -341,12 +364,23 @@ if (Module['quit']) quit_ = Module['quit']; var STACK_ALIGN = 16; +// stack management, and other functionality that is provided by the compiled code, +// should not be used before it is ready +stackSave = stackRestore = stackAlloc = function() { + abort('cannot use the stack before compiled code is ready to run, and has provided stack access'); +}; + +function staticAlloc(size) { + abort('staticAlloc is no longer available at runtime; instead, perform static allocations at compile time (using makeStaticAlloc)'); +} function dynamicAlloc(size) { + assert(DYNAMICTOP_PTR); + assert(!ENVIRONMENT_IS_PTHREAD); // this function is not thread-safe var ret = HEAP32[DYNAMICTOP_PTR>>2]; var end = (ret + size + 15) & -16; if (end > _emscripten_get_heap_size()) { - abort(); + abort('failure to dynamicAlloc - memory growth etc. is not supported there, call malloc/sbrk directly'); } HEAP32[DYNAMICTOP_PTR>>2] = end; return ret; @@ -392,6 +426,7 @@ var asm2wasmImports = { // special asm2wasm imports return x % y; }, "debugger": function() { + debugger; } }; @@ -520,6 +555,7 @@ function removeFunctionWasm(index) { // 'sig' parameter is required for the llvm backend but only when func is not // already a WebAssembly function. function addFunction(func, sig) { + assert(typeof func !== 'undefined'); return addFunctionWasm(func, sig); } @@ -564,8 +600,12 @@ function makeBigInt(low, high, unsigned) { function dynCall(sig, ptr, args) { if (args && args.length) { + assert(args.length == sig.length-1); + assert(('dynCall_' + sig) in Module, 'bad function pointer type - no table for sig \'' + sig + '\''); return Module['dynCall_' + sig].apply(null, [ptr].concat(args)); } else { + assert(sig.length == 1); + assert(('dynCall_' + sig) in Module, 'bad function pointer type - no table for sig \'' + sig + '\''); return Module['dynCall_' + sig].call(null, ptr); } } @@ -580,8 +620,15 @@ var getTempRet0 = function() { return tempRet0; }; +function getCompilerSetting(name) { + throw 'You must build with -s RETAIN_COMPILER_SETTINGS=1 for getCompilerSetting or emscripten_get_compiler_setting to work'; +} var Runtime = { + // helpful errors + getTempRet0: function() { abort('getTempRet0() is now a top-level function, after removing the Runtime object. Remove "Runtime."') }, + staticAlloc: function() { abort('staticAlloc() is now a top-level function, after removing the Runtime object. Remove "Runtime."') }, + stackAlloc: function() { abort('stackAlloc() is now a top-level function, after removing the Runtime object. Remove "Runtime."') }, }; // The address globals begin at. Very low in memory, for code size and optimization opportunities. @@ -615,12 +662,12 @@ var Atomics_compareExchange = Atomics.compareExchange; // is up at http://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html -var wasmBinary;if (Module['wasmBinary']) wasmBinary = Module['wasmBinary']; -var noExitRuntime;if (Module['noExitRuntime']) noExitRuntime = Module['noExitRuntime']; +var wasmBinary;if (Module['wasmBinary']) wasmBinary = Module['wasmBinary'];if (!Object.getOwnPropertyDescriptor(Module, 'wasmBinary')) Object.defineProperty(Module, 'wasmBinary', { configurable: true, get: function() { abort('Module.wasmBinary has been replaced with plain wasmBinary') } }); +var noExitRuntime;if (Module['noExitRuntime']) noExitRuntime = Module['noExitRuntime'];if (!Object.getOwnPropertyDescriptor(Module, 'noExitRuntime')) Object.defineProperty(Module, 'noExitRuntime', { configurable: true, get: function() { abort('Module.noExitRuntime has been replaced with plain noExitRuntime') } }); if (typeof WebAssembly !== 'object') { - err('no native wasm support detected'); + abort('No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.'); } @@ -672,8 +719,8 @@ var wasmMemory; // In the wasm backend, we polyfill the WebAssembly object, // so this creates a (non-native-wasm) table for us. var wasmTable = new WebAssembly.Table({ - 'initial': 58617, - 'maximum': 58617 + 0, + 'initial': 58765, + 'maximum': 58765 + 0, 'element': 'anyfunc' }); @@ -744,6 +791,7 @@ function ccall(ident, returnType, argTypes, args, opts) { var func = getCFunc(ident); var cArgs = []; var stack = 0; + assert(returnType !== 'array', 'Return type should not be "array".'); if (args) { for (var i = 0; i < args.length; i++) { var converter = toC[argTypes[i]]; @@ -763,14 +811,6 @@ function ccall(ident, returnType, argTypes, args, opts) { } function cwrap(ident, returnType, argTypes, opts) { - argTypes = argTypes || []; - // When the function takes numbers and returns a number, we can just return - // the original function - var numericArgs = argTypes.every(function(type){ return type === 'number'}); - var numericRet = returnType !== 'string'; - if (numericRet && numericArgs && !opts) { - return getCFunc(ident); - } return function() { return ccall(ident, returnType, argTypes, arguments, opts); } @@ -849,6 +889,7 @@ function allocate(slab, types, allocator, ptr) { i++; continue; } + assert(type, 'Must know what type to store in allocate!'); if (type == 'i64') type = 'i32'; // special case: we have one i32 here, and one i32 later @@ -928,6 +969,7 @@ function UTF8ArrayToString(u8Array, idx, maxBytesToRead) { if ((u0 & 0xF0) == 0xE0) { u0 = ((u0 & 15) << 12) | (u1 << 6) | u2; } else { + if ((u0 & 0xF8) != 0xF0) warnOnce('Invalid UTF-8 leading byte 0x' + u0.toString(16) + ' encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!'); u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | (u8Array[idx++] & 63); } @@ -1002,6 +1044,7 @@ function stringToUTF8Array(str, outU8Array, outIdx, maxBytesToWrite) { outU8Array[outIdx++] = 0x80 | (u & 63); } else { if (outIdx + 3 >= endIdx) break; + if (u >= 0x200000) warnOnce('Invalid Unicode code point 0x' + u.toString(16) + ' encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF).'); outU8Array[outIdx++] = 0xF0 | (u >> 18); outU8Array[outIdx++] = 0x80 | ((u >> 12) & 63); outU8Array[outIdx++] = 0x80 | ((u >> 6) & 63); @@ -1019,6 +1062,7 @@ function stringToUTF8Array(str, outU8Array, outIdx, maxBytesToWrite) { // Returns the number of bytes written, EXCLUDING the null terminator. function stringToUTF8(str, outPtr, maxBytesToWrite) { + assert(typeof maxBytesToWrite == 'number', 'stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!'); return stringToUTF8Array(str, HEAPU8,outPtr, maxBytesToWrite); } @@ -1043,6 +1087,7 @@ function lengthBytesUTF8(str) { // a copy of that string as a Javascript String object. function UTF16ToString(ptr) { + assert(ptr % 2 == 0, 'Pointer passed to UTF16ToString must be aligned to two bytes!'); var i = 0; var str = ''; @@ -1067,6 +1112,8 @@ function UTF16ToString(ptr) { // Returns the number of bytes written, EXCLUDING the null terminator. function stringToUTF16(str, outPtr, maxBytesToWrite) { + assert(outPtr % 2 == 0, 'Pointer passed to stringToUTF16 must be aligned to two bytes!'); + assert(typeof maxBytesToWrite == 'number', 'stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!'); // Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed. if (maxBytesToWrite === undefined) { maxBytesToWrite = 0x7FFFFFFF; @@ -1093,6 +1140,7 @@ function lengthBytesUTF16(str) { } function UTF32ToString(ptr) { + assert(ptr % 4 == 0, 'Pointer passed to UTF32ToString must be aligned to four bytes!'); var i = 0; var str = ''; @@ -1124,6 +1172,8 @@ function UTF32ToString(ptr) { // Returns the number of bytes written, EXCLUDING the null terminator. function stringToUTF32(str, outPtr, maxBytesToWrite) { + assert(outPtr % 4 == 0, 'Pointer passed to stringToUTF32 must be aligned to four bytes!'); + assert(typeof maxBytesToWrite == 'number', 'stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!'); // Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed. if (maxBytesToWrite === undefined) { maxBytesToWrite = 0x7FFFFFFF; @@ -1201,11 +1251,13 @@ function writeStringToMemory(string, buffer, dontAddNull) { } function writeArrayToMemory(array, buffer) { + assert(array.length >= 0, 'writeArrayToMemory array must have a length (should be an array or typed array)') HEAP8.set(array, buffer); } function writeAsciiToMemory(str, buffer, dontAddNull) { for (var i = 0; i < str.length; ++i) { + assert(str.charCodeAt(i) === str.charCodeAt(i)&0xff); HEAP8[((buffer++)>>0)]=str.charCodeAt(i); } // Null-terminate the pointer to the HEAP. @@ -1261,12 +1313,14 @@ function updateGlobalBufferAndViews(buf) { } var STATIC_BASE = 1024, - STACK_BASE = 15447248, + STACK_BASE = 15470352, STACKTOP = STACK_BASE, - STACK_MAX = 10204368, - DYNAMIC_BASE = 15447248, - DYNAMICTOP_PTR = 10203408; + STACK_MAX = 10227472, + DYNAMIC_BASE = 15470352, + DYNAMICTOP_PTR = 10226512; +assert(STACK_BASE % 16 === 0, 'stack must start aligned'); +assert(DYNAMIC_BASE % 16 === 0, 'heap must start aligned'); if (ENVIRONMENT_IS_PTHREAD) { @@ -1274,6 +1328,7 @@ if (ENVIRONMENT_IS_PTHREAD) { // but not ready to run yet. At 'run' we receive proper values for the stack // etc. and can launch a pthread. Set some fake values there meanwhile to // catch bugs, then set the real values in applyStackValues later. + STACK_MAX = STACKTOP = STACK_MAX = 0x7FFFFFFF; Module['applyStackValues'] = function(stackBase, stackTop, stackMax) { STACK_BASE = stackBase; @@ -1288,9 +1343,15 @@ if (ENVIRONMENT_IS_PTHREAD) { var TOTAL_STACK = 5242880; +if (Module['TOTAL_STACK']) assert(TOTAL_STACK === Module['TOTAL_STACK'], 'the stack size can no longer be determined at runtime') -var INITIAL_TOTAL_MEMORY = Module['TOTAL_MEMORY'] || 149880832; +var INITIAL_TOTAL_MEMORY = Module['TOTAL_MEMORY'] || 149880832;if (!Object.getOwnPropertyDescriptor(Module, 'TOTAL_MEMORY')) Object.defineProperty(Module, 'TOTAL_MEMORY', { configurable: true, get: function() { abort('Module.TOTAL_MEMORY has been replaced with plain INITIAL_TOTAL_MEMORY') } }); +assert(INITIAL_TOTAL_MEMORY >= TOTAL_STACK, 'TOTAL_MEMORY should be larger than TOTAL_STACK, was ' + INITIAL_TOTAL_MEMORY + '! (TOTAL_STACK=' + TOTAL_STACK + ')'); + +// check for full engine support (use string 'subarray' to avoid closure compiler confusion) +assert(typeof Int32Array !== 'undefined' && typeof Float64Array !== 'undefined' && Int32Array.prototype.subarray !== undefined && Int32Array.prototype.set !== undefined, + 'JS engine does not provide full typed array support'); @@ -1336,6 +1397,7 @@ if (wasmMemory) { // If the user provides an incorrect length, just use that length instead rather than providing the user to // specifically provide the memory length with Module['TOTAL_MEMORY']. INITIAL_TOTAL_MEMORY = buffer.byteLength; +assert(INITIAL_TOTAL_MEMORY % WASM_PAGE_SIZE === 0); updateGlobalBufferAndViews(buffer); if (!ENVIRONMENT_IS_PTHREAD) { // Pthreads have already initialized these variables in src/worker.js, where they were passed to the thread worker at startup time @@ -1345,10 +1407,47 @@ HEAP32[DYNAMICTOP_PTR>>2] = DYNAMIC_BASE; +// Initializes the stack cookie. Called at the startup of main and at the startup of each thread in pthreads mode. +function writeStackCookie() { + assert((STACK_MAX & 3) == 0); + // The stack grows downwards + HEAPU32[(STACK_MAX >> 2)+1] = 0x02135467; + HEAPU32[(STACK_MAX >> 2)+2] = 0x89BACDFE; + // Also test the global address 0 for integrity. + // We don't do this with ASan because ASan does its own checks for this. + HEAP32[0] = 0x63736d65; /* 'emsc' */ +} + +function checkStackCookie() { + var cookie1 = HEAPU32[(STACK_MAX >> 2)+1]; + var cookie2 = HEAPU32[(STACK_MAX >> 2)+2]; + if (cookie1 != 0x02135467 || cookie2 != 0x89BACDFE) { + abort('Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x02135467, but received 0x' + cookie2.toString(16) + ' ' + cookie1.toString(16)); + } + // Also test the global address 0 for integrity. + // We don't do this with ASan because ASan does its own checks for this. + if (HEAP32[0] !== 0x63736d65 /* 'emsc' */) abort('Runtime error: The application has corrupted its heap memory area (address zero)!'); +} + +function abortStackOverflow(allocSize) { + abort('Stack overflow! Attempted to allocate ' + allocSize + ' bytes on the stack, but stack has only ' + (STACK_MAX - stackSave() + allocSize) + ' bytes available!'); +} +// Endianness check (note: assumes compiler arch was little-endian) +(function() { + var h16 = new Int16Array(1); + var h8 = new Int8Array(h16.buffer); + h16[0] = 0x6373; + if (h8[0] !== 0x73 || h8[1] !== 0x63) throw 'Runtime error: expected the system to be little-endian!'; +})(); + +function abortFnPtrError(ptr, sig) { + abort("Invalid function pointer " + ptr + " called with signature '" + sig + "'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this). Build with ASSERTIONS=2 for more info."); +} + function callRuntimeCallbacks(callbacks) { @@ -1396,6 +1495,8 @@ function preRun() { } function initRuntime() { + checkStackCookie(); + assert(!runtimeInitialized); runtimeInitialized = true; if (!Module["noFSInit"] && !FS.init.initialized) FS.init(); TTY.init(); @@ -1403,17 +1504,20 @@ TTY.init(); } function preMain() { + checkStackCookie(); if (ENVIRONMENT_IS_PTHREAD) return; // PThreads reuse the runtime from the main thread. FS.ignorePermissions = false; callRuntimeCallbacks(__ATMAIN__); } function exitRuntime() { + checkStackCookie(); if (ENVIRONMENT_IS_PTHREAD) return; // PThreads reuse the runtime from the main thread. runtimeExited = true; } function postRun() { + checkStackCookie(); if (ENVIRONMENT_IS_PTHREAD) return; // PThreads reuse the runtime from the main thread. if (Module['postRun']) { @@ -1467,6 +1571,10 @@ function reSign(value, bits, ignore) { } +assert(Math.imul, 'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'); +assert(Math.fround, 'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'); +assert(Math.clz32, 'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'); +assert(Math.trunc, 'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'); var Math_abs = Math.abs; var Math_cos = Math.cos; @@ -1502,8 +1610,14 @@ var Math_trunc = Math.trunc; var runDependencies = 0; var runDependencyWatcher = null; var dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled +var runDependencyTracking = {}; function getUniqueRunDependency(id) { + var orig = id; + while (1) { + if (!runDependencyTracking[id]) return id; + id = orig + Math.random(); + } return id; } @@ -1517,6 +1631,33 @@ function addRunDependency(id) { Module['monitorRunDependencies'](runDependencies); } + if (id) { + assert(!runDependencyTracking[id]); + runDependencyTracking[id] = 1; + if (runDependencyWatcher === null && typeof setInterval !== 'undefined') { + // Check for missing dependencies every few seconds + runDependencyWatcher = setInterval(function() { + if (ABORT) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null; + return; + } + var shown = false; + for (var dep in runDependencyTracking) { + if (!shown) { + shown = true; + err('still waiting on run dependencies:'); + } + err('dependency: ' + dep); + } + if (shown) { + err('(end of list)'); + } + }, 10000); + } + } else { + err('warning: run dependency added without ID'); + } } function removeRunDependency(id) { @@ -1526,6 +1667,12 @@ function removeRunDependency(id) { Module['monitorRunDependencies'](runDependencies); } + if (id) { + assert(runDependencyTracking[id]); + delete runDependencyTracking[id]; + } else { + err('warning: run dependency removed without ID'); + } if (runDependencies == 0) { if (runDependencyWatcher !== null) { clearInterval(runDependencyWatcher); @@ -1556,7 +1703,8 @@ function abort(what) { ABORT = true; EXITSTATUS = 1; - what = 'abort(' + what + '). Build with -s ASSERTIONS=1 for more info.'; + var output = 'abort(' + what + ') at ' + stackTrace(); + what = output; // Throw a wasm runtime error, because a JS error might be seen as a foreign // exception, which means we'd run destructors on it. We need the error to @@ -1657,9 +1805,15 @@ function createWasm() { if (!ENVIRONMENT_IS_PTHREAD) { addRunDependency('wasm-instantiate'); } + // Async compilation can be confusing when an error on the page overwrites Module + // (for example, if the order of elements is wrong, and the one defining Module is + // later), so we save Module and check it later. + var trueModule = Module; function receiveInstantiatedSource(output) { // 'output' is a WebAssemblyInstantiatedSource object which has both the module and instance. // receiveInstance() will swap in the exports (to Module.asm) so they can be called + assert(Module === trueModule, 'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'); + trueModule = null; receiveInstance(output['instance'], output['module']); } @@ -1719,11 +1873,11 @@ var tempI64; var ASM_CONSTS = { 52684: function() {FS.mkdir('/working'); FS.mount(NODEFS, { root: '.' }, '/working');}, - 8571840: function() {throw 'Canceled!'}, - 8571979: function() {postMessage({cmd : 'processQueuedMainThreadWork'})}, - 8572030: function($0) {if (!ENVIRONMENT_IS_PTHREAD) { if (!PThread.pthreads[$0] || !PThread.pthreads[$0].worker) { return 0; } PThread.pthreads[$0].worker.postMessage({cmd : 'processThreadQueue'}); } else { postMessage({targetThread : $0, cmd : 'processThreadQueue'}); } return 1;}, - 8572398: function() {return !!(Module['canvas'])}, - 8572434: function() {noExitRuntime = true} + 8594176: function() {throw 'Canceled!'}, + 8594315: function() {postMessage({cmd : 'processQueuedMainThreadWork'})}, + 8594366: function($0) {if (!ENVIRONMENT_IS_PTHREAD) { if (!PThread.pthreads[$0] || !PThread.pthreads[$0].worker) { return 0; } PThread.pthreads[$0].worker.postMessage({cmd : 'processThreadQueue'}); } else { postMessage({targetThread : $0, cmd : 'processThreadQueue'}); } return 1;}, + 8594734: function() {return !!(Module['canvas'])}, + 8594770: function() {noExitRuntime = true} }; // Avoid creating a new array @@ -1743,7 +1897,7 @@ function readAsmConstArgs(sigPtr, buf) { buf = alignMemory(buf, 4); args.push(HEAP32[(buf >> 2)]); buf += 4; - } + } else abort("unexpected char in asm const signature " + ch); } } @@ -1755,7 +1909,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { -// STATICTOP = STATIC_BASE + 10203344; +// STATICTOP = STATIC_BASE + 10226448; /* global initializers */ if (!ENVIRONMENT_IS_PTHREAD) __ATINIT__.push({ func: function() { ___wasm_call_ctors() } }); @@ -1765,6 +1919,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { function demangle(func) { + warnOnce('warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling'); return func; } Module["demangle"] = demangle; @@ -1907,54 +2062,6 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { } Module["__ZN14NSHtmlRenderer17CASCHTMLRenderer3D1Ev"] = __ZN14NSHtmlRenderer17CASCHTMLRenderer3D1Ev; - function __ZN18NSUnicodeConverter17CUnicodeConverter11fromUnicodeEPKwRKjPKc( - ) { - err('missing function: _ZN18NSUnicodeConverter17CUnicodeConverter11fromUnicodeEPKwRKjPKc'); abort(-1); - } - Module["__ZN18NSUnicodeConverter17CUnicodeConverter11fromUnicodeEPKwRKjPKc"] = __ZN18NSUnicodeConverter17CUnicodeConverter11fromUnicodeEPKwRKjPKc; - - function __ZN18NSUnicodeConverter17CUnicodeConverter14toUnicodeExactEPKcRKjS2_( - ) { - err('missing function: _ZN18NSUnicodeConverter17CUnicodeConverter14toUnicodeExactEPKcRKjS2_'); abort(-1); - } - Module["__ZN18NSUnicodeConverter17CUnicodeConverter14toUnicodeExactEPKcRKjS2_"] = __ZN18NSUnicodeConverter17CUnicodeConverter14toUnicodeExactEPKcRKjS2_; - - function __ZN18NSUnicodeConverter17CUnicodeConverter14toUnicodeExactEPKcRKji( - ) { - err('missing function: _ZN18NSUnicodeConverter17CUnicodeConverter14toUnicodeExactEPKcRKji'); abort(-1); - } - Module["__ZN18NSUnicodeConverter17CUnicodeConverter14toUnicodeExactEPKcRKji"] = __ZN18NSUnicodeConverter17CUnicodeConverter14toUnicodeExactEPKcRKji; - - function __ZN18NSUnicodeConverter17CUnicodeConverter9toUnicodeEPKcRKjS2_( - ) { - err('missing function: _ZN18NSUnicodeConverter17CUnicodeConverter9toUnicodeEPKcRKjS2_'); abort(-1); - } - Module["__ZN18NSUnicodeConverter17CUnicodeConverter9toUnicodeEPKcRKjS2_"] = __ZN18NSUnicodeConverter17CUnicodeConverter9toUnicodeEPKcRKjS2_; - - function __ZN18NSUnicodeConverter17CUnicodeConverter9toUnicodeERKNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPKc( - ) { - err('missing function: _ZN18NSUnicodeConverter17CUnicodeConverter9toUnicodeERKNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPKc'); abort(-1); - } - Module["__ZN18NSUnicodeConverter17CUnicodeConverter9toUnicodeERKNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPKc"] = __ZN18NSUnicodeConverter17CUnicodeConverter9toUnicodeERKNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPKc; - - function __ZN18NSUnicodeConverter17CUnicodeConverter9toUnicodeERKNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEi( - ) { - err('missing function: _ZN18NSUnicodeConverter17CUnicodeConverter9toUnicodeERKNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEi'); abort(-1); - } - Module["__ZN18NSUnicodeConverter17CUnicodeConverter9toUnicodeERKNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEi"] = __ZN18NSUnicodeConverter17CUnicodeConverter9toUnicodeERKNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEi; - - function __ZN18NSUnicodeConverter17CUnicodeConverterC1Ev( - ) { - err('missing function: _ZN18NSUnicodeConverter17CUnicodeConverterC1Ev'); abort(-1); - } - Module["__ZN18NSUnicodeConverter17CUnicodeConverterC1Ev"] = __ZN18NSUnicodeConverter17CUnicodeConverterC1Ev; - - function __ZN18NSUnicodeConverter17CUnicodeConverterD1Ev( - ) { - err('missing function: _ZN18NSUnicodeConverter17CUnicodeConverterD1Ev'); abort(-1); - } - Module["__ZN18NSUnicodeConverter17CUnicodeConverterD1Ev"] = __ZN18NSUnicodeConverter17CUnicodeConverterD1Ev; - function __ZN23CFileDownloader_privateC1ENSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEEb( ) { err('missing function: _ZN23CFileDownloader_privateC1ENSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEEb'); abort(-1); @@ -2047,7 +2154,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { Module["ERRNO_CODES"] = ERRNO_CODES; - var __main_thread_futex_wait_address=10204352; + var __main_thread_futex_wait_address=10227456; Module["__main_thread_futex_wait_address"] = __main_thread_futex_wait_address;function _emscripten_futex_wake(addr, count) { if (addr <= 0 || addr > HEAP8.length || addr&3 != 0 || count < 0) return -28; if (count == 0) return 0; @@ -2118,7 +2225,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { if (ENVIRONMENT_IS_PTHREAD) return undefined; - PThread.mainThreadBlock = 10203568; + PThread.mainThreadBlock = 10226672; for (var i = 0; i < 244/4; ++i) HEAPU32[PThread.mainThreadBlock/4+i] = 0; @@ -2131,7 +2238,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { HEAP32[((headPtr)>>2)]=headPtr; // Allocate memory for thread-local storage. - var tlsMemory = 10203824; + var tlsMemory = 10226928; for (var i = 0; i < 128; ++i) HEAPU32[tlsMemory/4+i] = 0; Atomics.store(HEAPU32, (PThread.mainThreadBlock + 116 ) >> 2, tlsMemory); // Init thread-local-storage memory array. Atomics.store(HEAPU32, (PThread.mainThreadBlock + 52 ) >> 2, PThread.mainThreadBlock); // Main thread ID. @@ -2190,12 +2297,14 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { for (var i = 0; i < PThread.preallocatedWorkers.length; ++i) { var worker = PThread.preallocatedWorkers[i]; + assert(!worker.pthread); // This Worker should not be hosting a pthread at this time. worker.terminate(); } PThread.preallocatedWorkers = []; for (var i = 0; i < PThread.unusedWorkers.length; ++i) { var worker = PThread.unusedWorkers[i]; + assert(!worker.pthread); // This Worker should not be hosting a pthread at this time. worker.terminate(); } PThread.unusedWorkers = []; @@ -2203,6 +2312,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { for (var i = 0; i < PThread.runningWorkers.length; ++i) { var worker = PThread.runningWorkers[i]; var pthread = worker.pthread; + assert(pthread, 'This Worker should have a pthread it is executing'); PThread.freeThreadData(pthread); worker.terminate(); } @@ -2409,6 +2519,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { function ___setErrNo(value) { if (Module['___errno_location']) HEAP32[((Module['___errno_location']())>>2)]=value; + else err('failed to set errno from JS'); return value; } Module["___setErrNo"] = ___setErrNo;function _clock_gettime(clk_id, tp) { @@ -2441,6 +2552,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { function _atexit(func, arg) { if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(1, 1, func, arg); + warnOnce('atexit() called, but EXIT_RUNTIME is not set, so atexits() will not be called. set EXIT_RUNTIME to 1 (see the FAQ)'); __ATEXIT__.unshift({ func: func, arg: arg }); } @@ -2482,7 +2594,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { ___exception_infos[ptr].rethrown = true; } ___exception_last = ptr; - throw ptr; + throw ptr + " - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch."; } Module["___cxa_rethrow"] = ___cxa_rethrow; @@ -2502,7 +2614,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { } else { __ZSt18uncaught_exceptionv.uncaught_exceptions++; } - throw ptr; + throw ptr + " - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch."; } Module["___cxa_throw"] = ___cxa_throw; @@ -3000,6 +3112,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { var contents = stream.node.contents; if (position >= stream.node.usedBytes) return 0; var size = Math.min(stream.node.usedBytes - position, length); + assert(size >= 0); if (size > 8 && contents.subarray) { // non-trivial, and typed array buffer.set(contents.subarray(position, position + size), offset); } else { @@ -3007,6 +3120,8 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { } return size; },write:function(stream, buffer, offset, length, position, canOwn) { + // The data buffer should be a typed array view + assert(!(buffer instanceof ArrayBuffer)); if (!length) return 0; var node = stream.node; @@ -3014,6 +3129,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { if (buffer.subarray && (!node.contents || node.contents.subarray)) { // This write is from a typed array to a typed array? if (canOwn) { + assert(position === 0, 'canOwn must imply no weird position inside the file'); node.contents = buffer.subarray(offset, offset + length); node.usedBytes = length; return length; @@ -3054,6 +3170,8 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { MEMFS.expandFileStorage(stream.node, offset + length); stream.node.usedBytes = Math.max(stream.node.usedBytes, offset + length); },mmap:function(stream, buffer, offset, length, position, prot, flags) { + // The data buffer should be a typed array view + assert(!(buffer instanceof ArrayBuffer)); if (!FS.isFile(stream.node.mode)) { throw new FS.ErrnoError(43); } @@ -3355,7 +3473,10 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { return position; }}}; - Module["NODEFS"] = NODEFS;var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:function(e) { + Module["NODEFS"] = NODEFS; + + var ERRNO_MESSAGES={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"}; + Module["ERRNO_MESSAGES"] = ERRNO_MESSAGES;var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:function(e) { if (!(e instanceof FS.ErrnoError)) throw e + ' : ' + stackTrace(); return ___setErrNo(e.errno); },lookupPath:function(path, opts) { @@ -3709,6 +3830,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { var completed = 0; function doCallback(err) { + assert(FS.syncFSRequests > 0); FS.syncFSRequests--; return callback(err); } @@ -3734,6 +3856,11 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { mount.type.syncfs(mount, populate, done); }); },mount:function(type, opts, mountpoint) { + if (typeof type === 'string') { + // The filesystem was not included, and instead we have an error + // message stored in the variable. + throw type; + } var root = mountpoint === '/'; var pseudo = !mountpoint; var node; @@ -3811,6 +3938,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { // remove this mount from the child mounts var idx = node.mount.mounts.indexOf(mount); + assert(idx !== -1); node.mount.mounts.splice(idx, 1); },lookup:function(parent, name) { return parent.node_ops.lookup(parent, name); @@ -4479,7 +4607,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { {} if (!random_device) { // we couldn't find a proper implementation, as Math.random() is not suitable for /dev/random, see emscripten-core/emscripten/pull/7096 - random_device = function() { abort("random_device"); }; + random_device = function() { abort("no cryptographic support found for random_device. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };"); }; } FS.createDevice('/dev', 'random', random_device); FS.createDevice('/dev', 'urandom', random_device); @@ -4541,16 +4669,32 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { var stdin = FS.open('/dev/stdin', 'r'); var stdout = FS.open('/dev/stdout', 'w'); var stderr = FS.open('/dev/stderr', 'w'); + assert(stdin.fd === 0, 'invalid handle for stdin (' + stdin.fd + ')'); + assert(stdout.fd === 1, 'invalid handle for stdout (' + stdout.fd + ')'); + assert(stderr.fd === 2, 'invalid handle for stderr (' + stderr.fd + ')'); },ensureErrnoError:function() { if (FS.ErrnoError) return; FS.ErrnoError = function ErrnoError(errno, node) { this.node = node; this.setErrno = function(errno) { this.errno = errno; + for (var key in ERRNO_CODES) { + if (ERRNO_CODES[key] === errno) { + this.code = key; + break; + } + } }; this.setErrno(errno); - this.message = 'FS error'; + this.message = ERRNO_MESSAGES[errno]; + // Try to get a maximally helpful stack trace. On Node.js, getting Error.stack + // now ensures it shows what we want. + if (this.stack) { + // Define the stack property for Node.js 4, which otherwise errors on the next line. + Object.defineProperty(this, "stack", { value: (new Error).stack, writable: true }); + this.stack = demangleAll(this.stack); + } }; FS.ErrnoError.prototype = new Error(); FS.ErrnoError.prototype.constructor = FS.ErrnoError; @@ -4575,6 +4719,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { 'NODEFS': NODEFS, }; },init:function(input, output, error) { + assert(!FS.init.initialized, 'FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)'); FS.init.initialized = true; FS.ensureErrnoError(); @@ -4907,6 +5052,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { if (position >= contents.length) return 0; var size = Math.min(contents.length - position, length); + assert(size >= 0); if (contents.slice) { // normal array for (var i = 0; i < size; i++) { buffer[offset + i] = contents[position + i]; @@ -5167,9 +5313,11 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { return stream; },get64:function() { var low = SYSCALLS.get(), high = SYSCALLS.get(); + if (low >= 0) assert(high === 0); + else assert(high === -1); return low; },getZero:function() { - SYSCALLS.get(); + assert(SYSCALLS.get() === 0); }}; Module["SYSCALLS"] = SYSCALLS;function ___syscall10(which, varargs) { if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(2, 1, which, varargs); @@ -5223,9 +5371,104 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { Module["___syscall183"] = ___syscall183; - function ___syscall195(which, varargs) { + + + + function _memset(ptr, value, num) { + ptr = ptr|0; value = value|0; num = num|0; + var end = 0, aligned_end = 0, block_aligned_end = 0, value4 = 0; + end = (ptr + num)|0; + + value = value & 0xff; + if ((num|0) >= 67 /* 64 bytes for an unrolled loop + 3 bytes for unaligned head*/) { + while ((ptr&3) != 0) { + HEAP8[((ptr)>>0)]=value; + ptr = (ptr+1)|0; + } + + aligned_end = (end & -4)|0; + value4 = value | (value << 8) | (value << 16) | (value << 24); + + block_aligned_end = (aligned_end - 64)|0; + + while((ptr|0) <= (block_aligned_end|0)) { + HEAP32[((ptr)>>2)]=value4; + HEAP32[(((ptr)+(4))>>2)]=value4; + HEAP32[(((ptr)+(8))>>2)]=value4; + HEAP32[(((ptr)+(12))>>2)]=value4; + HEAP32[(((ptr)+(16))>>2)]=value4; + HEAP32[(((ptr)+(20))>>2)]=value4; + HEAP32[(((ptr)+(24))>>2)]=value4; + HEAP32[(((ptr)+(28))>>2)]=value4; + HEAP32[(((ptr)+(32))>>2)]=value4; + HEAP32[(((ptr)+(36))>>2)]=value4; + HEAP32[(((ptr)+(40))>>2)]=value4; + HEAP32[(((ptr)+(44))>>2)]=value4; + HEAP32[(((ptr)+(48))>>2)]=value4; + HEAP32[(((ptr)+(52))>>2)]=value4; + HEAP32[(((ptr)+(56))>>2)]=value4; + HEAP32[(((ptr)+(60))>>2)]=value4; + ptr = (ptr + 64)|0; + } + + while ((ptr|0) < (aligned_end|0) ) { + HEAP32[((ptr)>>2)]=value4; + ptr = (ptr+4)|0; + } + } + // The remaining bytes. + while ((ptr|0) < (end|0)) { + HEAP8[((ptr)>>0)]=value; + ptr = (ptr+1)|0; + } + return (end-num)|0; + } + Module["_memset"] = _memset;function __emscripten_syscall_mmap2(addr, len, prot, flags, fd, off) { + off <<= 12; // undo pgoffset + var ptr; + var allocated = false; + + // addr argument must be page aligned if MAP_FIXED flag is set. + if ((flags & 16) !== 0 && (addr % PAGE_SIZE) !== 0) { + return -28; + } + + // MAP_ANONYMOUS (aka MAP_ANON) isn't actually defined by POSIX spec, + // but it is widely used way to allocate memory pages on Linux, BSD and Mac. + // In this case fd argument is ignored. + if ((flags & 32) !== 0) { + ptr = _memalign(PAGE_SIZE, len); + if (!ptr) return -48; + _memset(ptr, 0, len); + allocated = true; + } else { + var info = FS.getStream(fd); + if (!info) return -8; + var res = FS.mmap(info, HEAPU8, addr, len, off, prot, flags); + ptr = res.ptr; + allocated = res.allocated; + } + SYSCALLS.mappings[ptr] = { malloc: ptr, len: len, allocated: allocated, fd: fd, flags: flags }; + return ptr; + } + Module["__emscripten_syscall_mmap2"] = __emscripten_syscall_mmap2;function ___syscall192(which, varargs) { if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(5, 1, which, varargs); SYSCALLS.varargs = varargs; + try { + // mmap2 + var addr = SYSCALLS.get(), len = SYSCALLS.get(), prot = SYSCALLS.get(), flags = SYSCALLS.get(), fd = SYSCALLS.get(), off = SYSCALLS.get() + return __emscripten_syscall_mmap2(addr, len, prot, flags, fd, off); + } catch (e) { + if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno; + } + } + + Module["___syscall192"] = ___syscall192; + + function ___syscall195(which, varargs) { + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(6, 1, which, varargs); + SYSCALLS.varargs = varargs; try { // SYS_stat64 var path = SYSCALLS.getStr(), buf = SYSCALLS.get(); @@ -5239,7 +5482,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { Module["___syscall195"] = ___syscall195; function ___syscall196(which, varargs) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(6, 1, which, varargs); + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(7, 1, which, varargs); SYSCALLS.varargs = varargs; try { // SYS_lstat64 @@ -5254,7 +5497,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { Module["___syscall196"] = ___syscall196; function ___syscall220(which, varargs) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(7, 1, which, varargs); + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(8, 1, which, varargs); SYSCALLS.varargs = varargs; try { // SYS_getdents64 @@ -5303,7 +5546,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { Module["___syscall220"] = ___syscall220; function ___syscall221(which, varargs) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(8, 1, which, varargs); + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(9, 1, which, varargs); SYSCALLS.varargs = varargs; try { // fcntl64 @@ -5364,7 +5607,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { Module["___syscall221"] = ___syscall221; function ___syscall3(which, varargs) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(9, 1, which, varargs); + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(10, 1, which, varargs); SYSCALLS.varargs = varargs; try { // read @@ -5379,7 +5622,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { Module["___syscall3"] = ___syscall3; function ___syscall39(which, varargs) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(10, 1, which, varargs); + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(11, 1, which, varargs); SYSCALLS.varargs = varargs; try { // mkdir @@ -5394,7 +5637,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { Module["___syscall39"] = ___syscall39; function ___syscall4(which, varargs) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(11, 1, which, varargs); + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(12, 1, which, varargs); SYSCALLS.varargs = varargs; try { // write @@ -5409,7 +5652,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { Module["___syscall4"] = ___syscall4; function ___syscall40(which, varargs) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(12, 1, which, varargs); + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(13, 1, which, varargs); SYSCALLS.varargs = varargs; try { // rmdir @@ -5425,7 +5668,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { Module["___syscall40"] = ___syscall40; function ___syscall5(which, varargs) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(13, 1, which, varargs); + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(14, 1, which, varargs); SYSCALLS.varargs = varargs; try { // open @@ -5441,7 +5684,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { Module["___syscall5"] = ___syscall5; function ___syscall54(which, varargs) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(14, 1, which, varargs); + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(15, 1, which, varargs); SYSCALLS.varargs = varargs; try { // ioctl @@ -5499,7 +5742,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { Module["___syscall54"] = ___syscall54; function ___syscall85(which, varargs) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(15, 1, which, varargs); + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(16, 1, which, varargs); SYSCALLS.varargs = varargs; try { // readlink @@ -5533,7 +5776,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { return 0; } Module["__emscripten_syscall_munmap"] = __emscripten_syscall_munmap;function ___syscall91(which, varargs) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(16, 1, which, varargs); + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(17, 1, which, varargs); SYSCALLS.varargs = varargs; try { // munmap @@ -5557,6 +5800,8 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { function _emscripten_check_blocking_allowed() { + assert(ENVIRONMENT_IS_WEB); + warnOnce('Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread'); } Module["_emscripten_check_blocking_allowed"] = _emscripten_check_blocking_allowed; @@ -5613,7 +5858,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { function _emscripten_get_sbrk_ptr() { - return 10203408; + return 10226512; } Module["_emscripten_get_sbrk_ptr"] = _emscripten_get_sbrk_ptr; @@ -5704,6 +5949,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { // all the args here. // We also pass 'sync' to C separately, since C needs to look at it. var numCallArgs = arguments.length - 2; + if (numCallArgs > 20-1) throw 'emscripten_proxy_to_main_thread_js: Too many arguments ' + numCallArgs + ' to proxied function idx=' + index + ', maximum supported is ' + (20-1) + '!'; // Allocate a buffer, which will be copied by the C code. var stack = stackSave(); // First passed parameter specifies the number of arguments to the function. @@ -5738,13 +5984,14 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { var constArgs = readAsmConstArgs(sigPtr, varargPtr); return func.apply(null, constArgs); } + assert(func.length == numCallArgs, 'Call args mismatch in emscripten_receive_on_main_thread_js'); return func.apply(null, _emscripten_receive_on_main_thread_js_callArgs); } Module["_emscripten_receive_on_main_thread_js"] = _emscripten_receive_on_main_thread_js; function abortOnCannotGrowMemory(requestedSize) { - abort('OOM'); + abort('Cannot enlarge memory arrays to size ' + requestedSize + ' bytes (OOM). Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value ' + HEAP8.length + ', (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 '); } Module["abortOnCannotGrowMemory"] = abortOnCannotGrowMemory;function _emscripten_resize_heap(requestedSize) { abortOnCannotGrowMemory(requestedSize); @@ -5909,6 +6156,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { var __specialEventTargets=[0, typeof document !== 'undefined' ? document : 0, typeof window !== 'undefined' ? window : 0]; Module["__specialEventTargets"] = __specialEventTargets;function __findEventTarget(target) { + warnOnce('Rules for selecting event targets in HTML5 API are changing: instead of using document.getElementById() that only can refer to elements by their DOM ID, new event target selection mechanism uses the more flexible function document.querySelector() that can look up element names, classes, and complex CSS selectors. Build with -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1 to change to the new lookup rules. See https://github.com/emscripten-core/emscripten/pull/7977 for more details.'); try { // The sensible "default" target varies between events, but use window as the default // since DOM events mostly can default to that. Specific callback registrations @@ -5976,7 +6224,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { Module["_emscripten_set_canvas_element_size_calling_thread"] = _emscripten_set_canvas_element_size_calling_thread; function _emscripten_set_canvas_element_size_main_thread(target, width, height) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(17, 1, target, width, height); + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(18, 1, target, width, height); return _emscripten_set_canvas_element_size_calling_thread(target, width, height); } Module["_emscripten_set_canvas_element_size_main_thread"] = _emscripten_set_canvas_element_size_main_thread;function _emscripten_set_canvas_element_size(target, width, height) { @@ -6011,6 +6259,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { case 10: return ___syscall10(which, varargs); case 12: return ___syscall12(which, varargs); case 183: return ___syscall183(which, varargs); + case 192: return ___syscall192(which, varargs); case 195: return ___syscall195(which, varargs); case 196: return ___syscall196(which, varargs); case 220: return ___syscall220(which, varargs); @@ -6230,6 +6479,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { } }}; Module["GL"] = GL;function _emscripten_webgl_do_create_context(target, attributes) { + assert(attributes); var contextAttributes = {}; var a = attributes >> 2; contextAttributes['alpha'] = !!HEAP32[a + (0>>2)]; @@ -6331,7 +6581,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { Module["_exit"] = _exit; function _fd_close(fd) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(18, 1, fd); + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(19, 1, fd); try { var stream = SYSCALLS.getStreamFromFD(fd); @@ -6346,7 +6596,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { Module["_fd_close"] = _fd_close; function _fd_read(fd, iov, iovcnt, pnum) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(19, 1, fd, iov, iovcnt, pnum); + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(20, 1, fd, iov, iovcnt, pnum); try { var stream = SYSCALLS.getStreamFromFD(fd); @@ -6362,7 +6612,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { Module["_fd_read"] = _fd_read; function _fd_seek(fd, offset_low, offset_high, whence, newOffset) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(20, 1, fd, offset_low, offset_high, whence, newOffset); + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(21, 1, fd, offset_low, offset_high, whence, newOffset); try { var stream = SYSCALLS.getStreamFromFD(fd); @@ -6389,7 +6639,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { Module["_fd_seek"] = _fd_seek; function _fd_write(fd, iov, iovcnt, pnum) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(21, 1, fd, iov, iovcnt, pnum); + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(22, 1, fd, iov, iovcnt, pnum); try { var stream = SYSCALLS.getStreamFromFD(fd); @@ -6418,11 +6668,11 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { Module["_gettimeofday"] = _gettimeofday; - var ___tm_current=10203424; + var ___tm_current=10226528; Module["___tm_current"] = ___tm_current; - var ___tm_timezone=(stringToUTF8("GMT", 10203472, 4), 10203472); + var ___tm_timezone=(stringToUTF8("GMT", 10226576, 4), 10226576); Module["___tm_timezone"] = ___tm_timezone;function _gmtime_r(time, tmPtr) { var date = new Date(HEAP32[((time)>>2)]*1000); HEAP32[((tmPtr)>>2)]=date.getUTCSeconds(); @@ -6446,7 +6696,6 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { } Module["_gmtime"] = _gmtime; - function _memcpy(dest, src, num) { dest = dest|0; src = src|0; num = num|0; var ret = 0; @@ -6519,60 +6768,10 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { } Module["_memcpy"] = _memcpy; - function _memset(ptr, value, num) { - ptr = ptr|0; value = value|0; num = num|0; - var end = 0, aligned_end = 0, block_aligned_end = 0, value4 = 0; - end = (ptr + num)|0; - - value = value & 0xff; - if ((num|0) >= 67 /* 64 bytes for an unrolled loop + 3 bytes for unaligned head*/) { - while ((ptr&3) != 0) { - HEAP8[((ptr)>>0)]=value; - ptr = (ptr+1)|0; - } - - aligned_end = (end & -4)|0; - value4 = value | (value << 8) | (value << 16) | (value << 24); - - block_aligned_end = (aligned_end - 64)|0; - - while((ptr|0) <= (block_aligned_end|0)) { - HEAP32[((ptr)>>2)]=value4; - HEAP32[(((ptr)+(4))>>2)]=value4; - HEAP32[(((ptr)+(8))>>2)]=value4; - HEAP32[(((ptr)+(12))>>2)]=value4; - HEAP32[(((ptr)+(16))>>2)]=value4; - HEAP32[(((ptr)+(20))>>2)]=value4; - HEAP32[(((ptr)+(24))>>2)]=value4; - HEAP32[(((ptr)+(28))>>2)]=value4; - HEAP32[(((ptr)+(32))>>2)]=value4; - HEAP32[(((ptr)+(36))>>2)]=value4; - HEAP32[(((ptr)+(40))>>2)]=value4; - HEAP32[(((ptr)+(44))>>2)]=value4; - HEAP32[(((ptr)+(48))>>2)]=value4; - HEAP32[(((ptr)+(52))>>2)]=value4; - HEAP32[(((ptr)+(56))>>2)]=value4; - HEAP32[(((ptr)+(60))>>2)]=value4; - ptr = (ptr + 64)|0; - } - - while ((ptr|0) < (aligned_end|0) ) { - HEAP32[((ptr)>>2)]=value4; - ptr = (ptr+4)|0; - } - } - // The remaining bytes. - while ((ptr|0) < (end|0)) { - HEAP8[((ptr)>>0)]=value; - ptr = (ptr+1)|0; - } - return (end-num)|0; - } - Module["_memset"] = _memset; function _tzset() { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(22, 1); + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(23, 1); // TODO: Use (malleable) environment variables instead of system settings. if (_tzset.called) return; @@ -7243,7 +7442,7 @@ function _emscripten_asm_const_iii(code, sigPtr, argbuf) { Module["_strftime_l"] = _strftime_l; function _sysconf(name) { - if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(23, 1, name); + if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(24, 1, name); // long sysconf(int name); // http://pubs.opengroup.org/onlinepubs/009695399/functions/sysconf.html @@ -7444,9 +7643,9 @@ var GLctx; GL.init(); // proxiedFunctionTable specifies the list of functions that can be called either synchronously or asynchronously from other threads in postMessage()d or internally queued events. This way a pthread in a Worker can synchronously access e.g. the DOM on the main thread. -var proxiedFunctionTable = [null,_atexit,___syscall10,___syscall12,___syscall183,___syscall195,___syscall196,___syscall220,___syscall221,___syscall3,___syscall39,___syscall4,___syscall40,___syscall5,___syscall54,___syscall85,___syscall91,_emscripten_set_canvas_element_size_main_thread,_fd_close,_fd_read,_fd_seek,_fd_write,_tzset,_sysconf]; +var proxiedFunctionTable = [null,_atexit,___syscall10,___syscall12,___syscall183,___syscall192,___syscall195,___syscall196,___syscall220,___syscall221,___syscall3,___syscall39,___syscall4,___syscall40,___syscall5,___syscall54,___syscall85,___syscall91,_emscripten_set_canvas_element_size_main_thread,_fd_close,_fd_read,_fd_seek,_fd_write,_tzset,_sysconf]; -var ASSERTIONS = false; +var ASSERTIONS = true; // Copyright 2017 The Emscripten Authors. All rights reserved. // Emscripten is available under two separate licenses, the MIT license and the @@ -7481,398 +7680,1319 @@ function intArrayToString(array) { // ASM_LIBRARY EXTERN PRIMITIVES: Int8Array,Int32Array var asmGlobalArg = {}; -var asmLibraryArg = { "_ZN12CPdfRenderer10SaveToFileERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEE": __ZN12CPdfRenderer10SaveToFileERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEE, "_ZN12CPdfRenderer11SetPasswordERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEE": __ZN12CPdfRenderer11SetPasswordERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEE, "_ZN12CPdfRenderer13SetDocumentIDERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEE": __ZN12CPdfRenderer13SetDocumentIDERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEE, "_ZN12CPdfRenderer13SetTempFolderERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEE": __ZN12CPdfRenderer13SetTempFolderERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEE, "_ZN12CPdfRenderer14SetThemesPlaceERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEE": __ZN12CPdfRenderer14SetThemesPlaceERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEE, "_ZN12CPdfRenderer15OnlineWordToPdfERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEES8_": __ZN12CPdfRenderer15OnlineWordToPdfERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEES8_, "_ZN12CPdfRenderer25OnlineWordToPdfFromBinaryERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEES8_": __ZN12CPdfRenderer25OnlineWordToPdfFromBinaryERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEES8_, "_ZN12CPdfRendererC1EPN7NSFonts17IApplicationFontsEb": __ZN12CPdfRendererC1EPN7NSFonts17IApplicationFontsEb, "_ZN12CPdfRendererD1Ev": __ZN12CPdfRendererD1Ev, "_ZN14NSDoctRenderer13CDoctrenderer18GetImagesInChangesEv": __ZN14NSDoctRenderer13CDoctrenderer18GetImagesInChangesEv, "_ZN14NSDoctRenderer13CDoctrenderer7ExecuteERKNSt3__212basic_stringIwNS1_11char_traitsIwEENS1_9allocatorIwEEEERS7_": __ZN14NSDoctRenderer13CDoctrenderer7ExecuteERKNSt3__212basic_stringIwNS1_11char_traitsIwEENS1_9allocatorIwEEEERS7_, "_ZN14NSDoctRenderer13CDoctrendererC1ERKNSt3__212basic_stringIwNS1_11char_traitsIwEENS1_9allocatorIwEEEE": __ZN14NSDoctRenderer13CDoctrendererC1ERKNSt3__212basic_stringIwNS1_11char_traitsIwEENS1_9allocatorIwEEEE, "_ZN14NSDoctRenderer13CDoctrendererD1Ev": __ZN14NSDoctRenderer13CDoctrendererD1Ev, "_ZN14NSHtmlRenderer17CASCHTMLRenderer316CreateOfficeFileENSt3__212basic_stringIwNS1_11char_traitsIwEENS1_9allocatorIwEEEERKS7_": __ZN14NSHtmlRenderer17CASCHTMLRenderer316CreateOfficeFileENSt3__212basic_stringIwNS1_11char_traitsIwEENS1_9allocatorIwEEEERKS7_, "_ZN14NSHtmlRenderer17CASCHTMLRenderer39CloseFileEb": __ZN14NSHtmlRenderer17CASCHTMLRenderer39CloseFileEb, "_ZN14NSHtmlRenderer17CASCHTMLRenderer3C1Ev": __ZN14NSHtmlRenderer17CASCHTMLRenderer3C1Ev, "_ZN14NSHtmlRenderer17CASCHTMLRenderer3D1Ev": __ZN14NSHtmlRenderer17CASCHTMLRenderer3D1Ev, "_ZN18NSUnicodeConverter17CUnicodeConverter11fromUnicodeEPKwRKjPKc": __ZN18NSUnicodeConverter17CUnicodeConverter11fromUnicodeEPKwRKjPKc, "_ZN18NSUnicodeConverter17CUnicodeConverter14toUnicodeExactEPKcRKjS2_": __ZN18NSUnicodeConverter17CUnicodeConverter14toUnicodeExactEPKcRKjS2_, "_ZN18NSUnicodeConverter17CUnicodeConverter14toUnicodeExactEPKcRKji": __ZN18NSUnicodeConverter17CUnicodeConverter14toUnicodeExactEPKcRKji, "_ZN18NSUnicodeConverter17CUnicodeConverter9toUnicodeEPKcRKjS2_": __ZN18NSUnicodeConverter17CUnicodeConverter9toUnicodeEPKcRKjS2_, "_ZN18NSUnicodeConverter17CUnicodeConverter9toUnicodeERKNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPKc": __ZN18NSUnicodeConverter17CUnicodeConverter9toUnicodeERKNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPKc, "_ZN18NSUnicodeConverter17CUnicodeConverter9toUnicodeERKNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEi": __ZN18NSUnicodeConverter17CUnicodeConverter9toUnicodeERKNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEi, "_ZN18NSUnicodeConverter17CUnicodeConverterC1Ev": __ZN18NSUnicodeConverter17CUnicodeConverterC1Ev, "_ZN18NSUnicodeConverter17CUnicodeConverterD1Ev": __ZN18NSUnicodeConverter17CUnicodeConverterD1Ev, "_ZN23CFileDownloader_privateC1ENSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEEb": __ZN23CFileDownloader_privateC1ENSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEEb, "_ZN8CXpsFileC1EPN7NSFonts17IApplicationFontsE": __ZN8CXpsFileC1EPN7NSFonts17IApplicationFontsE, "_ZN9CDjVuFileC1EPN7NSFonts17IApplicationFontsE": __ZN9CDjVuFileC1EPN7NSFonts17IApplicationFontsE, "_ZN9CHtmlFile10ConvertMhtERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEES8_S8_": __ZN9CHtmlFile10ConvertMhtERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEES8_S8_, "_ZN9CHtmlFile11ConvertEpubERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEERS6_S8_S8_": __ZN9CHtmlFile11ConvertEpubERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEERS6_S8_S8_, "_ZN9CHtmlFile7ConvertERKNSt3__26vectorINS0_12basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEENS5_IS7_EEEERKS7_SD_": __ZN9CHtmlFile7ConvertERKNSt3__26vectorINS0_12basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEENS5_IS7_EEEERKS7_SD_, "_ZN9CHtmlFileC1Ev": __ZN9CHtmlFileC1Ev, "_ZN9CHtmlFileD1Ev": __ZN9CHtmlFileD1Ev, "_ZN9PdfReader10CPdfReader8GetErrorEv": __ZN9PdfReader10CPdfReader8GetErrorEv, "_ZN9PdfReader10CPdfReaderC1EPN7NSFonts17IApplicationFontsE": __ZN9PdfReader10CPdfReaderC1EPN7NSFonts17IApplicationFontsE, "__assert_fail": ___assert_fail, "__call_main": ___call_main, "__clock_gettime": ___clock_gettime, "__cxa_allocate_exception": ___cxa_allocate_exception, "__cxa_atexit": ___cxa_atexit, "__cxa_rethrow": ___cxa_rethrow, "__cxa_throw": ___cxa_throw, "__lock": ___lock, "__map_file": ___map_file, "__syscall10": ___syscall10, "__syscall12": ___syscall12, "__syscall183": ___syscall183, "__syscall195": ___syscall195, "__syscall196": ___syscall196, "__syscall220": ___syscall220, "__syscall221": ___syscall221, "__syscall3": ___syscall3, "__syscall39": ___syscall39, "__syscall4": ___syscall4, "__syscall40": ___syscall40, "__syscall5": ___syscall5, "__syscall54": ___syscall54, "__syscall85": ___syscall85, "__syscall91": ___syscall91, "__unlock": ___unlock, "abort": _abort, "atexit": _atexit, "emscripten_asm_const_iii": _emscripten_asm_const_iii, "emscripten_check_blocking_allowed": _emscripten_check_blocking_allowed, "emscripten_conditional_set_current_thread_status": _emscripten_conditional_set_current_thread_status, "emscripten_futex_wait": _emscripten_futex_wait, "emscripten_futex_wake": _emscripten_futex_wake, "emscripten_get_now": _emscripten_get_now, "emscripten_get_sbrk_ptr": _emscripten_get_sbrk_ptr, "emscripten_has_threading_support": _emscripten_has_threading_support, "emscripten_is_main_browser_thread": _emscripten_is_main_browser_thread, "emscripten_is_main_runtime_thread": _emscripten_is_main_runtime_thread, "emscripten_longjmp": _emscripten_longjmp, "emscripten_memcpy_big": _emscripten_memcpy_big, "emscripten_receive_on_main_thread_js": _emscripten_receive_on_main_thread_js, "emscripten_resize_heap": _emscripten_resize_heap, "emscripten_set_canvas_element_size": _emscripten_set_canvas_element_size, "emscripten_set_current_thread_status": _emscripten_set_current_thread_status, "emscripten_set_thread_name": _emscripten_set_thread_name, "emscripten_syscall": _emscripten_syscall, "emscripten_webgl_create_context": _emscripten_webgl_create_context, "environ_get": _environ_get, "environ_sizes_get": _environ_sizes_get, "exit": _exit, "fd_close": _fd_close, "fd_read": _fd_read, "fd_seek": _fd_seek, "fd_write": _fd_write, "getTempRet0": _getTempRet0, "gettimeofday": _gettimeofday, "gmtime": _gmtime, "initPthreadsJS": initPthreadsJS, "invoke_ii": invoke_ii, "invoke_iii": invoke_iii, "invoke_iiii": invoke_iiii, "invoke_iiiii": invoke_iiiii, "invoke_iiiiii": invoke_iiiiii, "invoke_v": invoke_v, "invoke_vi": invoke_vi, "invoke_vii": invoke_vii, "invoke_viii": invoke_viii, "invoke_viiii": invoke_viiii, "invoke_viiiii": invoke_viiiii, "invoke_viiiiii": invoke_viiiiii, "invoke_viiiiiiiii": invoke_viiiiiiiii, "memory": wasmMemory, "mktime": _mktime, "pthread_cleanup_pop": _pthread_cleanup_pop, "pthread_cleanup_push": _pthread_cleanup_push, "pthread_create": _pthread_create, "pthread_self": _pthread_self, "saveSetjmp": _saveSetjmp, "setTempRet0": _setTempRet0, "strftime_l": _strftime_l, "sysconf": _sysconf, "system": _system, "table": wasmTable, "testSetjmp": _testSetjmp, "time": _time, "times": _times }; +var asmLibraryArg = { "_ZN12CPdfRenderer10SaveToFileERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEE": __ZN12CPdfRenderer10SaveToFileERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEE, "_ZN12CPdfRenderer11SetPasswordERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEE": __ZN12CPdfRenderer11SetPasswordERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEE, "_ZN12CPdfRenderer13SetDocumentIDERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEE": __ZN12CPdfRenderer13SetDocumentIDERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEE, "_ZN12CPdfRenderer13SetTempFolderERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEE": __ZN12CPdfRenderer13SetTempFolderERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEE, "_ZN12CPdfRenderer14SetThemesPlaceERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEE": __ZN12CPdfRenderer14SetThemesPlaceERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEE, "_ZN12CPdfRenderer15OnlineWordToPdfERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEES8_": __ZN12CPdfRenderer15OnlineWordToPdfERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEES8_, "_ZN12CPdfRenderer25OnlineWordToPdfFromBinaryERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEES8_": __ZN12CPdfRenderer25OnlineWordToPdfFromBinaryERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEES8_, "_ZN12CPdfRendererC1EPN7NSFonts17IApplicationFontsEb": __ZN12CPdfRendererC1EPN7NSFonts17IApplicationFontsEb, "_ZN12CPdfRendererD1Ev": __ZN12CPdfRendererD1Ev, "_ZN14NSDoctRenderer13CDoctrenderer18GetImagesInChangesEv": __ZN14NSDoctRenderer13CDoctrenderer18GetImagesInChangesEv, "_ZN14NSDoctRenderer13CDoctrenderer7ExecuteERKNSt3__212basic_stringIwNS1_11char_traitsIwEENS1_9allocatorIwEEEERS7_": __ZN14NSDoctRenderer13CDoctrenderer7ExecuteERKNSt3__212basic_stringIwNS1_11char_traitsIwEENS1_9allocatorIwEEEERS7_, "_ZN14NSDoctRenderer13CDoctrendererC1ERKNSt3__212basic_stringIwNS1_11char_traitsIwEENS1_9allocatorIwEEEE": __ZN14NSDoctRenderer13CDoctrendererC1ERKNSt3__212basic_stringIwNS1_11char_traitsIwEENS1_9allocatorIwEEEE, "_ZN14NSDoctRenderer13CDoctrendererD1Ev": __ZN14NSDoctRenderer13CDoctrendererD1Ev, "_ZN14NSHtmlRenderer17CASCHTMLRenderer316CreateOfficeFileENSt3__212basic_stringIwNS1_11char_traitsIwEENS1_9allocatorIwEEEERKS7_": __ZN14NSHtmlRenderer17CASCHTMLRenderer316CreateOfficeFileENSt3__212basic_stringIwNS1_11char_traitsIwEENS1_9allocatorIwEEEERKS7_, "_ZN14NSHtmlRenderer17CASCHTMLRenderer39CloseFileEb": __ZN14NSHtmlRenderer17CASCHTMLRenderer39CloseFileEb, "_ZN14NSHtmlRenderer17CASCHTMLRenderer3C1Ev": __ZN14NSHtmlRenderer17CASCHTMLRenderer3C1Ev, "_ZN14NSHtmlRenderer17CASCHTMLRenderer3D1Ev": __ZN14NSHtmlRenderer17CASCHTMLRenderer3D1Ev, "_ZN23CFileDownloader_privateC1ENSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEEb": __ZN23CFileDownloader_privateC1ENSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEEb, "_ZN8CXpsFileC1EPN7NSFonts17IApplicationFontsE": __ZN8CXpsFileC1EPN7NSFonts17IApplicationFontsE, "_ZN9CDjVuFileC1EPN7NSFonts17IApplicationFontsE": __ZN9CDjVuFileC1EPN7NSFonts17IApplicationFontsE, "_ZN9CHtmlFile10ConvertMhtERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEES8_S8_": __ZN9CHtmlFile10ConvertMhtERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEES8_S8_, "_ZN9CHtmlFile11ConvertEpubERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEERS6_S8_S8_": __ZN9CHtmlFile11ConvertEpubERKNSt3__212basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEERS6_S8_S8_, "_ZN9CHtmlFile7ConvertERKNSt3__26vectorINS0_12basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEENS5_IS7_EEEERKS7_SD_": __ZN9CHtmlFile7ConvertERKNSt3__26vectorINS0_12basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEENS5_IS7_EEEERKS7_SD_, "_ZN9CHtmlFileC1Ev": __ZN9CHtmlFileC1Ev, "_ZN9CHtmlFileD1Ev": __ZN9CHtmlFileD1Ev, "_ZN9PdfReader10CPdfReader8GetErrorEv": __ZN9PdfReader10CPdfReader8GetErrorEv, "_ZN9PdfReader10CPdfReaderC1EPN7NSFonts17IApplicationFontsE": __ZN9PdfReader10CPdfReaderC1EPN7NSFonts17IApplicationFontsE, "__assert_fail": ___assert_fail, "__call_main": ___call_main, "__clock_gettime": ___clock_gettime, "__cxa_allocate_exception": ___cxa_allocate_exception, "__cxa_atexit": ___cxa_atexit, "__cxa_rethrow": ___cxa_rethrow, "__cxa_throw": ___cxa_throw, "__lock": ___lock, "__map_file": ___map_file, "__syscall10": ___syscall10, "__syscall12": ___syscall12, "__syscall183": ___syscall183, "__syscall192": ___syscall192, "__syscall195": ___syscall195, "__syscall196": ___syscall196, "__syscall220": ___syscall220, "__syscall221": ___syscall221, "__syscall3": ___syscall3, "__syscall39": ___syscall39, "__syscall4": ___syscall4, "__syscall40": ___syscall40, "__syscall5": ___syscall5, "__syscall54": ___syscall54, "__syscall85": ___syscall85, "__syscall91": ___syscall91, "__unlock": ___unlock, "abort": _abort, "atexit": _atexit, "emscripten_asm_const_iii": _emscripten_asm_const_iii, "emscripten_check_blocking_allowed": _emscripten_check_blocking_allowed, "emscripten_conditional_set_current_thread_status": _emscripten_conditional_set_current_thread_status, "emscripten_futex_wait": _emscripten_futex_wait, "emscripten_futex_wake": _emscripten_futex_wake, "emscripten_get_now": _emscripten_get_now, "emscripten_get_sbrk_ptr": _emscripten_get_sbrk_ptr, "emscripten_has_threading_support": _emscripten_has_threading_support, "emscripten_is_main_browser_thread": _emscripten_is_main_browser_thread, "emscripten_is_main_runtime_thread": _emscripten_is_main_runtime_thread, "emscripten_longjmp": _emscripten_longjmp, "emscripten_memcpy_big": _emscripten_memcpy_big, "emscripten_receive_on_main_thread_js": _emscripten_receive_on_main_thread_js, "emscripten_resize_heap": _emscripten_resize_heap, "emscripten_set_canvas_element_size": _emscripten_set_canvas_element_size, "emscripten_set_current_thread_status": _emscripten_set_current_thread_status, "emscripten_set_thread_name": _emscripten_set_thread_name, "emscripten_syscall": _emscripten_syscall, "emscripten_webgl_create_context": _emscripten_webgl_create_context, "environ_get": _environ_get, "environ_sizes_get": _environ_sizes_get, "exit": _exit, "fd_close": _fd_close, "fd_read": _fd_read, "fd_seek": _fd_seek, "fd_write": _fd_write, "getTempRet0": _getTempRet0, "gettimeofday": _gettimeofday, "gmtime": _gmtime, "initPthreadsJS": initPthreadsJS, "invoke_ii": invoke_ii, "invoke_iii": invoke_iii, "invoke_iiii": invoke_iiii, "invoke_iiiii": invoke_iiiii, "invoke_iiiiii": invoke_iiiiii, "invoke_v": invoke_v, "invoke_vi": invoke_vi, "invoke_vii": invoke_vii, "invoke_viii": invoke_viii, "invoke_viiii": invoke_viiii, "invoke_viiiii": invoke_viiiii, "invoke_viiiiii": invoke_viiiiii, "invoke_viiiiiiiii": invoke_viiiiiiiii, "memory": wasmMemory, "mktime": _mktime, "pthread_cleanup_pop": _pthread_cleanup_pop, "pthread_cleanup_push": _pthread_cleanup_push, "pthread_create": _pthread_create, "pthread_self": _pthread_self, "saveSetjmp": _saveSetjmp, "setTempRet0": _setTempRet0, "strftime_l": _strftime_l, "sysconf": _sysconf, "system": _system, "table": wasmTable, "testSetjmp": _testSetjmp, "time": _time, "times": _times }; var asm = createWasm(); +var real____wasm_call_ctors = asm["__wasm_call_ctors"]; +asm["__wasm_call_ctors"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real____wasm_call_ctors.apply(null, arguments); +}; + +var real__runX2T = asm["runX2T"]; +asm["runX2T"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__runX2T.apply(null, arguments); +}; + +var real__malloc = asm["malloc"]; +asm["malloc"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__malloc.apply(null, arguments); +}; + +var real__free = asm["free"]; +asm["free"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__free.apply(null, arguments); +}; + +var real__main = asm["main"]; +asm["main"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__main.apply(null, arguments); +}; + +var real__fflush = asm["fflush"]; +asm["fflush"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__fflush.apply(null, arguments); +}; + +var real__realloc = asm["realloc"]; +asm["realloc"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__realloc.apply(null, arguments); +}; + +var real___ZSt18uncaught_exceptionv = asm["_ZSt18uncaught_exceptionv"]; +asm["_ZSt18uncaught_exceptionv"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real___ZSt18uncaught_exceptionv.apply(null, arguments); +}; + +var real____errno_location = asm["__errno_location"]; +asm["__errno_location"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real____errno_location.apply(null, arguments); +}; + +var real__ntohs = asm["ntohs"]; +asm["ntohs"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__ntohs.apply(null, arguments); +}; + +var real__htonl = asm["htonl"]; +asm["htonl"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__htonl.apply(null, arguments); +}; + +var real__htons = asm["htons"]; +asm["htons"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__htons.apply(null, arguments); +}; + +var real____em_js__initPthreadsJS = asm["__em_js__initPthreadsJS"]; +asm["__em_js__initPthreadsJS"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real____em_js__initPthreadsJS.apply(null, arguments); +}; + +var real____emscripten_pthread_data_constructor = asm["__emscripten_pthread_data_constructor"]; +asm["__emscripten_pthread_data_constructor"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real____emscripten_pthread_data_constructor.apply(null, arguments); +}; + +var real__emscripten_get_global_libc = asm["emscripten_get_global_libc"]; +asm["emscripten_get_global_libc"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__emscripten_get_global_libc.apply(null, arguments); +}; + +var real___get_tzname = asm["_get_tzname"]; +asm["_get_tzname"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real___get_tzname.apply(null, arguments); +}; + +var real___get_daylight = asm["_get_daylight"]; +asm["_get_daylight"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real___get_daylight.apply(null, arguments); +}; + +var real___get_timezone = asm["_get_timezone"]; +asm["_get_timezone"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real___get_timezone.apply(null, arguments); +}; + +var real__setThrew = asm["setThrew"]; +asm["setThrew"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__setThrew.apply(null, arguments); +}; + +var real__memalign = asm["memalign"]; +asm["memalign"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__memalign.apply(null, arguments); +}; + +var real__emscripten_builtin_free = asm["emscripten_builtin_free"]; +asm["emscripten_builtin_free"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__emscripten_builtin_free.apply(null, arguments); +}; + +var real__emscripten_builtin_memalign = asm["emscripten_builtin_memalign"]; +asm["emscripten_builtin_memalign"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__emscripten_builtin_memalign.apply(null, arguments); +}; + +var real__emscripten_main_browser_thread_id = asm["emscripten_main_browser_thread_id"]; +asm["emscripten_main_browser_thread_id"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__emscripten_main_browser_thread_id.apply(null, arguments); +}; + +var real____pthread_tsd_run_dtors = asm["__pthread_tsd_run_dtors"]; +asm["__pthread_tsd_run_dtors"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real____pthread_tsd_run_dtors.apply(null, arguments); +}; + +var real__emscripten_main_thread_process_queued_calls = asm["emscripten_main_thread_process_queued_calls"]; +asm["emscripten_main_thread_process_queued_calls"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__emscripten_main_thread_process_queued_calls.apply(null, arguments); +}; + +var real__emscripten_current_thread_process_queued_calls = asm["emscripten_current_thread_process_queued_calls"]; +asm["emscripten_current_thread_process_queued_calls"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__emscripten_current_thread_process_queued_calls.apply(null, arguments); +}; + +var real__usleep = asm["usleep"]; +asm["usleep"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__usleep.apply(null, arguments); +}; + +var real__emscripten_register_main_browser_thread_id = asm["emscripten_register_main_browser_thread_id"]; +asm["emscripten_register_main_browser_thread_id"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__emscripten_register_main_browser_thread_id.apply(null, arguments); +}; + +var real__emscripten_async_run_in_main_thread = asm["emscripten_async_run_in_main_thread"]; +asm["emscripten_async_run_in_main_thread"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__emscripten_async_run_in_main_thread.apply(null, arguments); +}; + +var real__emscripten_sync_run_in_main_thread = asm["emscripten_sync_run_in_main_thread"]; +asm["emscripten_sync_run_in_main_thread"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__emscripten_sync_run_in_main_thread.apply(null, arguments); +}; + +var real__emscripten_sync_run_in_main_thread_0 = asm["emscripten_sync_run_in_main_thread_0"]; +asm["emscripten_sync_run_in_main_thread_0"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__emscripten_sync_run_in_main_thread_0.apply(null, arguments); +}; + +var real__emscripten_sync_run_in_main_thread_1 = asm["emscripten_sync_run_in_main_thread_1"]; +asm["emscripten_sync_run_in_main_thread_1"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__emscripten_sync_run_in_main_thread_1.apply(null, arguments); +}; + +var real__emscripten_sync_run_in_main_thread_2 = asm["emscripten_sync_run_in_main_thread_2"]; +asm["emscripten_sync_run_in_main_thread_2"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__emscripten_sync_run_in_main_thread_2.apply(null, arguments); +}; + +var real__emscripten_sync_run_in_main_thread_xprintf_varargs = asm["emscripten_sync_run_in_main_thread_xprintf_varargs"]; +asm["emscripten_sync_run_in_main_thread_xprintf_varargs"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__emscripten_sync_run_in_main_thread_xprintf_varargs.apply(null, arguments); +}; + +var real__emscripten_sync_run_in_main_thread_3 = asm["emscripten_sync_run_in_main_thread_3"]; +asm["emscripten_sync_run_in_main_thread_3"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__emscripten_sync_run_in_main_thread_3.apply(null, arguments); +}; + +var real__emscripten_sync_run_in_main_thread_4 = asm["emscripten_sync_run_in_main_thread_4"]; +asm["emscripten_sync_run_in_main_thread_4"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__emscripten_sync_run_in_main_thread_4.apply(null, arguments); +}; + +var real__emscripten_sync_run_in_main_thread_5 = asm["emscripten_sync_run_in_main_thread_5"]; +asm["emscripten_sync_run_in_main_thread_5"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__emscripten_sync_run_in_main_thread_5.apply(null, arguments); +}; + +var real__emscripten_sync_run_in_main_thread_6 = asm["emscripten_sync_run_in_main_thread_6"]; +asm["emscripten_sync_run_in_main_thread_6"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__emscripten_sync_run_in_main_thread_6.apply(null, arguments); +}; + +var real__emscripten_sync_run_in_main_thread_7 = asm["emscripten_sync_run_in_main_thread_7"]; +asm["emscripten_sync_run_in_main_thread_7"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__emscripten_sync_run_in_main_thread_7.apply(null, arguments); +}; + +var real__emscripten_run_in_main_runtime_thread_js = asm["emscripten_run_in_main_runtime_thread_js"]; +asm["emscripten_run_in_main_runtime_thread_js"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__emscripten_run_in_main_runtime_thread_js.apply(null, arguments); +}; + +var real__emscripten_async_queue_on_thread_ = asm["emscripten_async_queue_on_thread_"]; +asm["emscripten_async_queue_on_thread_"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__emscripten_async_queue_on_thread_.apply(null, arguments); +}; + +var real__proxy_main = asm["proxy_main"]; +asm["proxy_main"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__proxy_main.apply(null, arguments); +}; + +var real__emscripten_tls_init = asm["emscripten_tls_init"]; +asm["emscripten_tls_init"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real__emscripten_tls_init.apply(null, arguments); +}; + +var real_dynCall_ii = asm["dynCall_ii"]; +asm["dynCall_ii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_ii.apply(null, arguments); +}; + +var real_dynCall_iii = asm["dynCall_iii"]; +asm["dynCall_iii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_iii.apply(null, arguments); +}; + +var real_dynCall_iiii = asm["dynCall_iiii"]; +asm["dynCall_iiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_iiii.apply(null, arguments); +}; + +var real_dynCall_iiiii = asm["dynCall_iiiii"]; +asm["dynCall_iiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_iiiii.apply(null, arguments); +}; + +var real_dynCall_iiiiii = asm["dynCall_iiiiii"]; +asm["dynCall_iiiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_iiiiii.apply(null, arguments); +}; + +var real_dynCall_v = asm["dynCall_v"]; +asm["dynCall_v"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_v.apply(null, arguments); +}; + +var real_dynCall_vi = asm["dynCall_vi"]; +asm["dynCall_vi"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_vi.apply(null, arguments); +}; + +var real_dynCall_vii = asm["dynCall_vii"]; +asm["dynCall_vii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_vii.apply(null, arguments); +}; + +var real_dynCall_viii = asm["dynCall_viii"]; +asm["dynCall_viii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_viii.apply(null, arguments); +}; + +var real_dynCall_viiii = asm["dynCall_viiii"]; +asm["dynCall_viiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_viiii.apply(null, arguments); +}; + +var real_dynCall_viiiii = asm["dynCall_viiiii"]; +asm["dynCall_viiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_viiiii.apply(null, arguments); +}; + +var real_dynCall_viiiiii = asm["dynCall_viiiiii"]; +asm["dynCall_viiiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_viiiiii.apply(null, arguments); +}; + +var real_dynCall_viiiiiiiii = asm["dynCall_viiiiiiiii"]; +asm["dynCall_viiiiiiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_viiiiiiiii.apply(null, arguments); +}; + +var real_stackSave = asm["stackSave"]; +asm["stackSave"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_stackSave.apply(null, arguments); +}; + +var real_stackAlloc = asm["stackAlloc"]; +asm["stackAlloc"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_stackAlloc.apply(null, arguments); +}; + +var real_stackRestore = asm["stackRestore"]; +asm["stackRestore"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_stackRestore.apply(null, arguments); +}; + +var real___growWasmMemory = asm["__growWasmMemory"]; +asm["__growWasmMemory"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real___growWasmMemory.apply(null, arguments); +}; + +var real_dynCall_viijii = asm["dynCall_viijii"]; +asm["dynCall_viijii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_viijii.apply(null, arguments); +}; + +var real_dynCall_dii = asm["dynCall_dii"]; +asm["dynCall_dii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_dii.apply(null, arguments); +}; + +var real_dynCall_did = asm["dynCall_did"]; +asm["dynCall_did"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_did.apply(null, arguments); +}; + +var real_dynCall_di = asm["dynCall_di"]; +asm["dynCall_di"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_di.apply(null, arguments); +}; + +var real_dynCall_ji = asm["dynCall_ji"]; +asm["dynCall_ji"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_ji.apply(null, arguments); +}; + +var real_dynCall_vij = asm["dynCall_vij"]; +asm["dynCall_vij"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_vij.apply(null, arguments); +}; + +var real_dynCall_jii = asm["dynCall_jii"]; +asm["dynCall_jii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_jii.apply(null, arguments); +}; + +var real_dynCall_iiiiiii = asm["dynCall_iiiiiii"]; +asm["dynCall_iiiiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_iiiiiii.apply(null, arguments); +}; + +var real_dynCall_iiiiiiii = asm["dynCall_iiiiiiii"]; +asm["dynCall_iiiiiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_iiiiiiii.apply(null, arguments); +}; + +var real_dynCall_iiiiiiiii = asm["dynCall_iiiiiiiii"]; +asm["dynCall_iiiiiiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_iiiiiiiii.apply(null, arguments); +}; + +var real_dynCall_iidddddi = asm["dynCall_iidddddi"]; +asm["dynCall_iidddddi"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_iidddddi.apply(null, arguments); +}; + +var real_dynCall_viiiddii = asm["dynCall_viiiddii"]; +asm["dynCall_viiiddii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_viiiddii.apply(null, arguments); +}; + +var real_dynCall_viij = asm["dynCall_viij"]; +asm["dynCall_viij"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_viij.apply(null, arguments); +}; + +var real_dynCall_viji = asm["dynCall_viji"]; +asm["dynCall_viji"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_viji.apply(null, arguments); +}; + +var real_dynCall_jij = asm["dynCall_jij"]; +asm["dynCall_jij"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_jij.apply(null, arguments); +}; + +var real_dynCall_iiiijii = asm["dynCall_iiiijii"]; +asm["dynCall_iiiijii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_iiiijii.apply(null, arguments); +}; + +var real_dynCall_viiij = asm["dynCall_viiij"]; +asm["dynCall_viiij"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_viiij.apply(null, arguments); +}; + +var real_dynCall_viiiiiiiiii = asm["dynCall_viiiiiiiiii"]; +asm["dynCall_viiiiiiiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_viiiiiiiiii.apply(null, arguments); +}; + +var real_dynCall_i = asm["dynCall_i"]; +asm["dynCall_i"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_i.apply(null, arguments); +}; + +var real_dynCall_viiiiiii = asm["dynCall_viiiiiii"]; +asm["dynCall_viiiiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_viiiiiii.apply(null, arguments); +}; + +var real_dynCall_viiiiiiiiiiii = asm["dynCall_viiiiiiiiiiii"]; +asm["dynCall_viiiiiiiiiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_viiiiiiiiiiii.apply(null, arguments); +}; + +var real_dynCall_iidd = asm["dynCall_iidd"]; +asm["dynCall_iidd"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_iidd.apply(null, arguments); +}; + +var real_dynCall_iidddddd = asm["dynCall_iidddddd"]; +asm["dynCall_iidddddd"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_iidddddd.apply(null, arguments); +}; + +var real_dynCall_vidd = asm["dynCall_vidd"]; +asm["dynCall_vidd"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_vidd.apply(null, arguments); +}; + +var real_dynCall_vidddd = asm["dynCall_vidddd"]; +asm["dynCall_vidddd"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_vidddd.apply(null, arguments); +}; + +var real_dynCall_viidddd = asm["dynCall_viidddd"]; +asm["dynCall_viidddd"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_viidddd.apply(null, arguments); +}; + +var real_dynCall_viidddddd = asm["dynCall_viidddddd"]; +asm["dynCall_viidddddd"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_viidddddd.apply(null, arguments); +}; + +var real_dynCall_iiiiiddd = asm["dynCall_iiiiiddd"]; +asm["dynCall_iiiiiddd"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_iiiiiddd.apply(null, arguments); +}; + +var real_dynCall_viiiiddd = asm["dynCall_viiiiddd"]; +asm["dynCall_viiiiddd"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_viiiiddd.apply(null, arguments); +}; + +var real_dynCall_diiii = asm["dynCall_diiii"]; +asm["dynCall_diiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_diiii.apply(null, arguments); +}; + +var real_dynCall_iiidddd = asm["dynCall_iiidddd"]; +asm["dynCall_iiidddd"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_iiidddd.apply(null, arguments); +}; + +var real_dynCall_viddddiii = asm["dynCall_viddddiii"]; +asm["dynCall_viddddiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_viddddiii.apply(null, arguments); +}; + +var real_dynCall_viiiddi = asm["dynCall_viiiddi"]; +asm["dynCall_viiiddi"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_viiiddi.apply(null, arguments); +}; + +var real_dynCall_vidddddd = asm["dynCall_vidddddd"]; +asm["dynCall_vidddddd"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_vidddddd.apply(null, arguments); +}; + +var real_dynCall_iiiiiiiiii = asm["dynCall_iiiiiiiiii"]; +asm["dynCall_iiiiiiiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_iiiiiiiiii.apply(null, arguments); +}; + +var real_dynCall_jiji = asm["dynCall_jiji"]; +asm["dynCall_jiji"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_jiji.apply(null, arguments); +}; + +var real_dynCall_iidiiii = asm["dynCall_iidiiii"]; +asm["dynCall_iidiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_iidiiii.apply(null, arguments); +}; + +var real_dynCall_iiiiij = asm["dynCall_iiiiij"]; +asm["dynCall_iiiiij"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_iiiiij.apply(null, arguments); +}; + +var real_dynCall_iiiiid = asm["dynCall_iiiiid"]; +asm["dynCall_iiiiid"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_iiiiid.apply(null, arguments); +}; + +var real_dynCall_iiiiijj = asm["dynCall_iiiiijj"]; +asm["dynCall_iiiiijj"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_iiiiijj.apply(null, arguments); +}; + +var real_dynCall_iiiiiijj = asm["dynCall_iiiiiijj"]; +asm["dynCall_iiiiiijj"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return real_dynCall_iiiiiijj.apply(null, arguments); +}; + Module["asm"] = asm; var ___wasm_call_ctors = Module["___wasm_call_ctors"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["__wasm_call_ctors"].apply(null, arguments) }; var _runX2T = Module["_runX2T"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["runX2T"].apply(null, arguments) }; var _malloc = Module["_malloc"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["malloc"].apply(null, arguments) }; var _free = Module["_free"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["free"].apply(null, arguments) }; var _main = Module["_main"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["main"].apply(null, arguments) }; +var _fflush = Module["_fflush"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return Module["asm"]["fflush"].apply(null, arguments) +}; + var _realloc = Module["_realloc"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["realloc"].apply(null, arguments) }; var __ZSt18uncaught_exceptionv = Module["__ZSt18uncaught_exceptionv"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["_ZSt18uncaught_exceptionv"].apply(null, arguments) }; var ___errno_location = Module["___errno_location"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["__errno_location"].apply(null, arguments) }; var _ntohs = Module["_ntohs"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["ntohs"].apply(null, arguments) }; var _htonl = Module["_htonl"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["htonl"].apply(null, arguments) }; var _htons = Module["_htons"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["htons"].apply(null, arguments) }; -var _emscripten_get_global_libc = Module["_emscripten_get_global_libc"] = function() { - return Module["asm"]["emscripten_get_global_libc"].apply(null, arguments) -}; - var ___em_js__initPthreadsJS = Module["___em_js__initPthreadsJS"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["__em_js__initPthreadsJS"].apply(null, arguments) }; var ___emscripten_pthread_data_constructor = Module["___emscripten_pthread_data_constructor"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["__emscripten_pthread_data_constructor"].apply(null, arguments) }; +var _emscripten_get_global_libc = Module["_emscripten_get_global_libc"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return Module["asm"]["emscripten_get_global_libc"].apply(null, arguments) +}; + var __get_tzname = Module["__get_tzname"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["_get_tzname"].apply(null, arguments) }; var __get_daylight = Module["__get_daylight"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["_get_daylight"].apply(null, arguments) }; var __get_timezone = Module["__get_timezone"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["_get_timezone"].apply(null, arguments) }; var _setThrew = Module["_setThrew"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["setThrew"].apply(null, arguments) }; var _memalign = Module["_memalign"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["memalign"].apply(null, arguments) }; +var _emscripten_builtin_free = Module["_emscripten_builtin_free"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return Module["asm"]["emscripten_builtin_free"].apply(null, arguments) +}; + +var _emscripten_builtin_memalign = Module["_emscripten_builtin_memalign"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); + return Module["asm"]["emscripten_builtin_memalign"].apply(null, arguments) +}; + var _emscripten_main_browser_thread_id = Module["_emscripten_main_browser_thread_id"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["emscripten_main_browser_thread_id"].apply(null, arguments) }; var ___pthread_tsd_run_dtors = Module["___pthread_tsd_run_dtors"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["__pthread_tsd_run_dtors"].apply(null, arguments) }; var _emscripten_main_thread_process_queued_calls = Module["_emscripten_main_thread_process_queued_calls"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["emscripten_main_thread_process_queued_calls"].apply(null, arguments) }; var _emscripten_current_thread_process_queued_calls = Module["_emscripten_current_thread_process_queued_calls"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["emscripten_current_thread_process_queued_calls"].apply(null, arguments) }; var _usleep = Module["_usleep"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["usleep"].apply(null, arguments) }; var _emscripten_register_main_browser_thread_id = Module["_emscripten_register_main_browser_thread_id"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["emscripten_register_main_browser_thread_id"].apply(null, arguments) }; var _emscripten_async_run_in_main_thread = Module["_emscripten_async_run_in_main_thread"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["emscripten_async_run_in_main_thread"].apply(null, arguments) }; var _emscripten_sync_run_in_main_thread = Module["_emscripten_sync_run_in_main_thread"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["emscripten_sync_run_in_main_thread"].apply(null, arguments) }; var _emscripten_sync_run_in_main_thread_0 = Module["_emscripten_sync_run_in_main_thread_0"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["emscripten_sync_run_in_main_thread_0"].apply(null, arguments) }; var _emscripten_sync_run_in_main_thread_1 = Module["_emscripten_sync_run_in_main_thread_1"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["emscripten_sync_run_in_main_thread_1"].apply(null, arguments) }; var _emscripten_sync_run_in_main_thread_2 = Module["_emscripten_sync_run_in_main_thread_2"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["emscripten_sync_run_in_main_thread_2"].apply(null, arguments) }; var _emscripten_sync_run_in_main_thread_xprintf_varargs = Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["emscripten_sync_run_in_main_thread_xprintf_varargs"].apply(null, arguments) }; var _emscripten_sync_run_in_main_thread_3 = Module["_emscripten_sync_run_in_main_thread_3"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["emscripten_sync_run_in_main_thread_3"].apply(null, arguments) }; var _emscripten_sync_run_in_main_thread_4 = Module["_emscripten_sync_run_in_main_thread_4"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["emscripten_sync_run_in_main_thread_4"].apply(null, arguments) }; var _emscripten_sync_run_in_main_thread_5 = Module["_emscripten_sync_run_in_main_thread_5"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["emscripten_sync_run_in_main_thread_5"].apply(null, arguments) }; var _emscripten_sync_run_in_main_thread_6 = Module["_emscripten_sync_run_in_main_thread_6"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["emscripten_sync_run_in_main_thread_6"].apply(null, arguments) }; var _emscripten_sync_run_in_main_thread_7 = Module["_emscripten_sync_run_in_main_thread_7"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["emscripten_sync_run_in_main_thread_7"].apply(null, arguments) }; var _emscripten_run_in_main_runtime_thread_js = Module["_emscripten_run_in_main_runtime_thread_js"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["emscripten_run_in_main_runtime_thread_js"].apply(null, arguments) }; var _emscripten_async_queue_on_thread_ = Module["_emscripten_async_queue_on_thread_"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["emscripten_async_queue_on_thread_"].apply(null, arguments) }; var _proxy_main = Module["_proxy_main"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["proxy_main"].apply(null, arguments) }; var _emscripten_tls_init = Module["_emscripten_tls_init"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["emscripten_tls_init"].apply(null, arguments) }; var dynCall_ii = Module["dynCall_ii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_ii"].apply(null, arguments) }; var dynCall_iii = Module["dynCall_iii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_iii"].apply(null, arguments) }; var dynCall_iiii = Module["dynCall_iiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_iiii"].apply(null, arguments) }; var dynCall_iiiii = Module["dynCall_iiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_iiiii"].apply(null, arguments) }; var dynCall_iiiiii = Module["dynCall_iiiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_iiiiii"].apply(null, arguments) }; var dynCall_v = Module["dynCall_v"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_v"].apply(null, arguments) }; var dynCall_vi = Module["dynCall_vi"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_vi"].apply(null, arguments) }; var dynCall_vii = Module["dynCall_vii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_vii"].apply(null, arguments) }; var dynCall_viii = Module["dynCall_viii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_viii"].apply(null, arguments) }; var dynCall_viiii = Module["dynCall_viiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_viiii"].apply(null, arguments) }; var dynCall_viiiii = Module["dynCall_viiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_viiiii"].apply(null, arguments) }; var dynCall_viiiiii = Module["dynCall_viiiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_viiiiii"].apply(null, arguments) }; var dynCall_viiiiiiiii = Module["dynCall_viiiiiiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_viiiiiiiii"].apply(null, arguments) }; var stackSave = Module["stackSave"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["stackSave"].apply(null, arguments) }; var stackAlloc = Module["stackAlloc"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["stackAlloc"].apply(null, arguments) }; var stackRestore = Module["stackRestore"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["stackRestore"].apply(null, arguments) }; var __growWasmMemory = Module["__growWasmMemory"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["__growWasmMemory"].apply(null, arguments) }; var dynCall_viijii = Module["dynCall_viijii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_viijii"].apply(null, arguments) }; var dynCall_dii = Module["dynCall_dii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_dii"].apply(null, arguments) }; var dynCall_did = Module["dynCall_did"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_did"].apply(null, arguments) }; var dynCall_di = Module["dynCall_di"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_di"].apply(null, arguments) }; var dynCall_ji = Module["dynCall_ji"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_ji"].apply(null, arguments) }; var dynCall_vij = Module["dynCall_vij"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_vij"].apply(null, arguments) }; var dynCall_jii = Module["dynCall_jii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_jii"].apply(null, arguments) }; var dynCall_iiiiiii = Module["dynCall_iiiiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_iiiiiii"].apply(null, arguments) }; var dynCall_iiiiiiii = Module["dynCall_iiiiiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_iiiiiiii"].apply(null, arguments) }; var dynCall_iiiiiiiii = Module["dynCall_iiiiiiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_iiiiiiiii"].apply(null, arguments) }; var dynCall_iidddddi = Module["dynCall_iidddddi"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_iidddddi"].apply(null, arguments) }; var dynCall_viiiddii = Module["dynCall_viiiddii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_viiiddii"].apply(null, arguments) }; var dynCall_viij = Module["dynCall_viij"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_viij"].apply(null, arguments) }; var dynCall_viji = Module["dynCall_viji"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_viji"].apply(null, arguments) }; var dynCall_jij = Module["dynCall_jij"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_jij"].apply(null, arguments) }; var dynCall_iiiijii = Module["dynCall_iiiijii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_iiiijii"].apply(null, arguments) }; var dynCall_viiij = Module["dynCall_viiij"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_viiij"].apply(null, arguments) }; var dynCall_viiiiiiiiii = Module["dynCall_viiiiiiiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_viiiiiiiiii"].apply(null, arguments) }; var dynCall_i = Module["dynCall_i"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_i"].apply(null, arguments) }; var dynCall_viiiiiii = Module["dynCall_viiiiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_viiiiiii"].apply(null, arguments) }; var dynCall_viiiiiiiiiiii = Module["dynCall_viiiiiiiiiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_viiiiiiiiiiii"].apply(null, arguments) }; var dynCall_iidd = Module["dynCall_iidd"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_iidd"].apply(null, arguments) }; var dynCall_iidddddd = Module["dynCall_iidddddd"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_iidddddd"].apply(null, arguments) }; var dynCall_vidd = Module["dynCall_vidd"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_vidd"].apply(null, arguments) }; var dynCall_vidddd = Module["dynCall_vidddd"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_vidddd"].apply(null, arguments) }; var dynCall_viidddd = Module["dynCall_viidddd"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_viidddd"].apply(null, arguments) }; var dynCall_viidddddd = Module["dynCall_viidddddd"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_viidddddd"].apply(null, arguments) }; var dynCall_iiiiiddd = Module["dynCall_iiiiiddd"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_iiiiiddd"].apply(null, arguments) }; var dynCall_viiiiddd = Module["dynCall_viiiiddd"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_viiiiddd"].apply(null, arguments) }; var dynCall_diiii = Module["dynCall_diiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_diiii"].apply(null, arguments) }; var dynCall_iiidddd = Module["dynCall_iiidddd"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_iiidddd"].apply(null, arguments) }; var dynCall_viddddiii = Module["dynCall_viddddiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_viddddiii"].apply(null, arguments) }; var dynCall_viiiddi = Module["dynCall_viiiddi"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_viiiddi"].apply(null, arguments) }; var dynCall_vidddddd = Module["dynCall_vidddddd"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_vidddddd"].apply(null, arguments) }; var dynCall_iiiiiiiiii = Module["dynCall_iiiiiiiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_iiiiiiiiii"].apply(null, arguments) }; var dynCall_jiji = Module["dynCall_jiji"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_jiji"].apply(null, arguments) }; var dynCall_iidiiii = Module["dynCall_iidiiii"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_iidiiii"].apply(null, arguments) }; var dynCall_iiiiij = Module["dynCall_iiiiij"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_iiiiij"].apply(null, arguments) }; var dynCall_iiiiid = Module["dynCall_iiiiid"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_iiiiid"].apply(null, arguments) }; var dynCall_iiiiijj = Module["dynCall_iiiiijj"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_iiiiijj"].apply(null, arguments) }; var dynCall_iiiiiijj = Module["dynCall_iiiiiijj"] = function() { + assert(runtimeInitialized, 'you need to wait for the runtime to be ready (e.g. wait for main() to be called)'); + assert(!runtimeExited, 'the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)'); return Module["asm"]["dynCall_iiiiiijj"].apply(null, arguments) }; @@ -8026,76 +9146,79 @@ function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9) { Module['asm'] = asm; - - +if (!Object.getOwnPropertyDescriptor(Module, "intArrayFromString")) Module["intArrayFromString"] = function() { abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "intArrayToString")) Module["intArrayToString"] = function() { abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; Module["ccall"] = ccall; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +if (!Object.getOwnPropertyDescriptor(Module, "cwrap")) Module["cwrap"] = function() { abort("'cwrap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "setValue")) Module["setValue"] = function() { abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "getValue")) Module["getValue"] = function() { abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "allocate")) Module["allocate"] = function() { abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "getMemory")) Module["getMemory"] = function() { abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") }; +if (!Object.getOwnPropertyDescriptor(Module, "AsciiToString")) Module["AsciiToString"] = function() { abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "stringToAscii")) Module["stringToAscii"] = function() { abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "UTF8ArrayToString")) Module["UTF8ArrayToString"] = function() { abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "UTF8ToString")) Module["UTF8ToString"] = function() { abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8Array")) Module["stringToUTF8Array"] = function() { abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8")) Module["stringToUTF8"] = function() { abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF8")) Module["lengthBytesUTF8"] = function() { abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "UTF16ToString")) Module["UTF16ToString"] = function() { abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF16")) Module["stringToUTF16"] = function() { abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF16")) Module["lengthBytesUTF16"] = function() { abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "UTF32ToString")) Module["UTF32ToString"] = function() { abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF32")) Module["stringToUTF32"] = function() { abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF32")) Module["lengthBytesUTF32"] = function() { abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8")) Module["allocateUTF8"] = function() { abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function() { abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "addOnPreRun")) Module["addOnPreRun"] = function() { abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "addOnInit")) Module["addOnInit"] = function() { abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "addOnPreMain")) Module["addOnPreMain"] = function() { abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "addOnExit")) Module["addOnExit"] = function() { abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "addOnPostRun")) Module["addOnPostRun"] = function() { abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "writeStringToMemory")) Module["writeStringToMemory"] = function() { abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "writeArrayToMemory")) Module["writeArrayToMemory"] = function() { abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "writeAsciiToMemory")) Module["writeAsciiToMemory"] = function() { abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "addRunDependency")) Module["addRunDependency"] = function() { abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") }; +if (!Object.getOwnPropertyDescriptor(Module, "removeRunDependency")) Module["removeRunDependency"] = function() { abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") }; +if (!Object.getOwnPropertyDescriptor(Module, "ENV")) Module["ENV"] = function() { abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "FS")) Module["FS"] = function() { abort("'FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "FS_createFolder")) Module["FS_createFolder"] = function() { abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") }; +if (!Object.getOwnPropertyDescriptor(Module, "FS_createPath")) Module["FS_createPath"] = function() { abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") }; +if (!Object.getOwnPropertyDescriptor(Module, "FS_createDataFile")) Module["FS_createDataFile"] = function() { abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") }; +if (!Object.getOwnPropertyDescriptor(Module, "FS_createPreloadedFile")) Module["FS_createPreloadedFile"] = function() { abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") }; +if (!Object.getOwnPropertyDescriptor(Module, "FS_createLazyFile")) Module["FS_createLazyFile"] = function() { abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") }; +if (!Object.getOwnPropertyDescriptor(Module, "FS_createLink")) Module["FS_createLink"] = function() { abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") }; +if (!Object.getOwnPropertyDescriptor(Module, "FS_createDevice")) Module["FS_createDevice"] = function() { abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") }; +if (!Object.getOwnPropertyDescriptor(Module, "FS_unlink")) Module["FS_unlink"] = function() { abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") }; +if (!Object.getOwnPropertyDescriptor(Module, "GL")) Module["GL"] = function() { abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "dynamicAlloc")) Module["dynamicAlloc"] = function() { abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "loadDynamicLibrary")) Module["loadDynamicLibrary"] = function() { abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "loadWebAssemblyModule")) Module["loadWebAssemblyModule"] = function() { abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "getLEB")) Module["getLEB"] = function() { abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "getFunctionTables")) Module["getFunctionTables"] = function() { abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "alignFunctionTables")) Module["alignFunctionTables"] = function() { abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "registerFunctions")) Module["registerFunctions"] = function() { abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "addFunction")) Module["addFunction"] = function() { abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "removeFunction")) Module["removeFunction"] = function() { abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "getFuncWrapper")) Module["getFuncWrapper"] = function() { abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "prettyPrint")) Module["prettyPrint"] = function() { abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "makeBigInt")) Module["makeBigInt"] = function() { abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "dynCall")) Module["dynCall"] = function() { abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "getCompilerSetting")) Module["getCompilerSetting"] = function() { abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "stackSave")) Module["stackSave"] = function() { abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "stackRestore")) Module["stackRestore"] = function() { abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "stackAlloc")) Module["stackAlloc"] = function() { abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; Module["establishStackSpace"] = establishStackSpace; - - - - - - - - +if (!Object.getOwnPropertyDescriptor(Module, "print")) Module["print"] = function() { abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "printErr")) Module["printErr"] = function() { abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "getTempRet0")) Module["getTempRet0"] = function() { abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "setTempRet0")) Module["setTempRet0"] = function() { abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "callMain")) Module["callMain"] = function() { abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "abort")) Module["abort"] = function() { abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "Pointer_stringify")) Module["Pointer_stringify"] = function() { abort("'Pointer_stringify' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +if (!Object.getOwnPropertyDescriptor(Module, "warnOnce")) Module["warnOnce"] = function() { abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") }; +Module["writeStackCookie"] = writeStackCookie; +Module["checkStackCookie"] = checkStackCookie; +Module["abortStackOverflow"] = abortStackOverflow; Module["PThread"] = PThread; Module["ExitStatus"] = ExitStatus; Module["tempDoublePtr"] = tempDoublePtr; @@ -8103,11 +9226,11 @@ Module["wasmMemory"] = wasmMemory; Module["_pthread_self"] = _pthread_self; Module["ExitStatus"] = ExitStatus; Module["tempDoublePtr"] = tempDoublePtr; -Module["dynCall_ii"] = dynCall_ii; - - - - +Module["dynCall_ii"] = dynCall_ii;if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NORMAL")) Object.defineProperty(Module, "ALLOC_NORMAL", { configurable: true, get: function() { abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") } }); +if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_STACK")) Object.defineProperty(Module, "ALLOC_STACK", { configurable: true, get: function() { abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") } }); +if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_DYNAMIC")) Object.defineProperty(Module, "ALLOC_DYNAMIC", { configurable: true, get: function() { abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") } }); +if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NONE")) Object.defineProperty(Module, "ALLOC_NONE", { configurable: true, get: function() { abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") } }); +if (!Object.getOwnPropertyDescriptor(Module, "calledRun")) Object.defineProperty(Module, "calledRun", { configurable: true, get: function() { abort("'calledRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") } }); @@ -8134,6 +9257,8 @@ dependenciesFulfilled = function runCaller() { }; function callMain(args) { + assert(runDependencies == 0, 'cannot call main when async dependencies remain! (listen on Module["onRuntimeInitialized"])'); + assert(__ATPRERUN__.length == 0, 'cannot call main when preRun functions remain to be called'); var entryFunction = Module['_main']; @@ -8191,6 +9316,7 @@ function run(args) { return; } + writeStackCookie(); preRun(); @@ -8227,11 +9353,52 @@ function run(args) { { doRun(); } + checkStackCookie(); } Module['run'] = run; +function checkUnflushedContent() { + // Compiler settings do not allow exiting the runtime, so flushing + // the streams is not possible. but in ASSERTIONS mode we check + // if there was something to flush, and if so tell the user they + // should request that the runtime be exitable. + // Normally we would not even include flush() at all, but in ASSERTIONS + // builds we do so just for this check, and here we see if there is any + // content to flush, that is, we check if there would have been + // something a non-ASSERTIONS build would have not seen. + // How we flush the streams depends on whether we are in SYSCALLS_REQUIRE_FILESYSTEM=0 + // mode (which has its own special function for this; otherwise, all + // the code is inside libc) + var print = out; + var printErr = err; + var has = false; + out = err = function(x) { + has = true; + } + try { // it doesn't matter if it fails + var flush = Module['_fflush']; + if (flush) flush(0); + // also flush in the JS FS layer + ['stdout', 'stderr'].forEach(function(name) { + var info = FS.analyzePath('/dev/' + name); + if (!info) return; + var stream = info.object; + var rdev = stream.rdev; + var tty = TTY.ttys[rdev]; + if (tty && tty.output && tty.output.length) { + has = true; + } + }); + } catch(e) {} + out = print; + err = printErr; + if (has) { + warnOnce('stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the FAQ), or make sure to emit a newline when you printf etc.'); + } +} function exit(status, implicit) { + checkUnflushedContent(); // if this is just main exit-ing implicitly, and the status is 0, then we // don't need to do anything here and can just leave. if the status is @@ -8242,6 +9409,10 @@ function exit(status, implicit) { } if (noExitRuntime) { + // if exit() was called, we may warn the user if the runtime isn't actually being shut down + if (!implicit) { + err('program exited (with status: ' + status + '), but EXIT_RUNTIME is not set, so halting execution but not exiting the runtime or preventing further async execution (build with EXIT_RUNTIME=1, if you want a true shutdown)'); + } } else { PThread.terminateAllThreads(); diff --git a/www/common/onlyoffice/x2t/x2t.wasm b/www/common/onlyoffice/x2t/x2t.wasm index f1b1b4a1a..fee376cd2 100644 Binary files a/www/common/onlyoffice/x2t/x2t.wasm and b/www/common/onlyoffice/x2t/x2t.wasm differ diff --git a/www/common/onlyoffice/x2t/x2t.worker.js b/www/common/onlyoffice/x2t/x2t.worker.js index d8628a4ba..9f738e1d7 100644 --- a/www/common/onlyoffice/x2t/x2t.worker.js +++ b/www/common/onlyoffice/x2t/x2t.worker.js @@ -26,6 +26,9 @@ var Module = {}; // These modes need to assign to these variables because of how scoping works in them. +function assert(condition, text) { + if (!condition) abort('Assertion failed: ' + text); +} function threadPrintErr() { var text = Array.prototype.slice.call(arguments).join(' '); @@ -103,9 +106,16 @@ this.onmessage = function(e) { var max = e.data.stackBase; var top = e.data.stackBase + e.data.stackSize; Module['applyStackValues'](top, top, max); + assert(threadInfoStruct); + assert(selfThreadId); + assert(parentThreadId); + assert(top != 0); + assert(max === e.data.stackBase); + assert(top > max); // Call inside asm.js/wasm module to set up the stack frame for this pthread in asm.js/wasm module scope Module['establishStackSpace'](e.data.stackBase, e.data.stackBase + e.data.stackSize); Module['_emscripten_tls_init'](); + Module['writeStackCookie'](); PThread.receiveObjectTransfer(e.data); PThread.setThreadStatus(Module['_pthread_self'](), 1/*EM_THREAD_STATUS_RUNNING*/); @@ -120,6 +130,7 @@ this.onmessage = function(e) { // flag -s EMULATE_FUNCTION_POINTER_CASTS=1 to add in emulation for this x86 ABI extension. var result = Module['dynCall_ii'](e.data.start_routine, e.data.arg); + Module['checkStackCookie'](); } catch(e) { if (e === 'Canceled!') { @@ -130,6 +141,10 @@ this.onmessage = function(e) { } else { Atomics.store(HEAPU32, (threadInfoStruct + 4 /*C_STRUCTS.pthread.threadExitCode*/ ) >> 2, (e instanceof Module['ExitStatus']) ? e.status : -2 /*A custom entry specific to Emscripten denoting that the thread crashed.*/); Atomics.store(HEAPU32, (threadInfoStruct + 0 /*C_STRUCTS.pthread.threadStatus*/ ) >> 2, 1); // Mark the thread as no longer running. + if (typeof(Module['_emscripten_futex_wake']) !== "function") { + err("Thread Initialisation failed."); + throw e; + } Module['_emscripten_futex_wake'](threadInfoStruct + 0 /*C_STRUCTS.pthread.threadStatus*/, 0x7FFFFFFF/*INT_MAX*/); // Wake all threads waiting on this thread to finish. if (!(e instanceof Module['ExitStatus'])) throw e; }