commit | bddbbca7b9b02d3ae156bed516c738793248b355 | [log] [tgz] |
---|---|---|
author | Stuart Schechter <UppaJung@users.noreply.github.com> | Wed May 27 14:52:08 2020 |
committer | GitHub <noreply@github.com> | Wed May 27 14:52:08 2020 |
tree | 5ec6e0c39ec535a29504523a2894a8bd60b9cead | |
parent | 2509ec99911317d7c82cfbe09ae80793e4cddc93 [diff] |
Fix broken promise when loading wasm from array buffer (#11245) When loading wasm from an array buffer, then() was being called BEFORE the module was fully loaded. I traced the error back to this line, where there's a missing return. With the return, the result will be a promise that resolves AFTER the module is instantiated. Without that return statement, then() may be called prematurely, as the promise returned is for the completion of this function without awaiting the instantiation. For those curious, to reproduce this bug, I was compiling with these options and running on node 10. However, it's hard to reproduce precisely because it's a race condition. -s MODULARIZE=1 -s ASSERTIONS=2 -s WASM_MEM_MAX=4GB -s ALLOW_MEMORY_GROWTH=1 -s SINGLE_FILE=1 -g4
Main project page: http://emscripten.org
Emscripten compiles C and C++ to WebAssembly using LLVM and Binaryen. Emscripten output can run on the Web, in Node.js, and in wasm runtimes.
Emscripten provides Web support for popular portable APIs such as OpenGL and SDL2, allowing complex graphical native applications to be ported, such as the Unity game engine and Google Earth. It can probably port your codebase, too!
While Emscripten mostly focuses on compiling C and C++ using Clang, it can be integrated with other LLVM-using compilers (for example, Rust has Emscripten integration, with the wasm32-unknown-emscripten
and asmjs-unknown-emscripten
targets).
Emscripten is available under 2 licenses, the MIT license and the University of Illinois/NCSA Open Source License.
Both are permissive open source licenses, with little if any practical difference between them.
The reason for offering both is that (1) the MIT license is well-known, while (2) the University of Illinois/NCSA Open Source License allows Emscripten's code to be integrated upstream into LLVM, which uses that license, should the opportunity arise.
See LICENSE
for the full content of the licenses.