diff options
author | Derek Schuff <dschuff@chromium.org> | 2016-06-02 14:30:30 -0700 |
---|---|---|
committer | Derek Schuff <dschuff@chromium.org> | 2016-06-02 14:30:30 -0700 |
commit | d4dc216888d5028f41e6189e65001694e49a66c2 (patch) | |
tree | 35ac5962bedb07fa732b34b62f7b7c3d68280ce4 /src/asmjs | |
parent | d595e89003dc3636952de4c561679e3a077e6015 (diff) | |
download | binaryen-d4dc216888d5028f41e6189e65001694e49a66c2.tar.gz binaryen-d4dc216888d5028f41e6189e65001694e49a66c2.tar.bz2 binaryen-d4dc216888d5028f41e6189e65001694e49a66c2.zip |
Generate thunks for address-taken imports (#554)
Under emscripten, C code can take the address of a function implemented
in Javascript (which is exposed via an import in wasm). Because imports
do not have linear memory address in wasm, we need to generate a thunk
to be the target of the indirect call; it call the import directly.
This is facilited by a new .s directive (.functype) which declares the
types of functions which are declared but not defined.
Fixes https://github.com/WebAssembly/binaryen/issues/392
Diffstat (limited to 'src/asmjs')
-rw-r--r-- | src/asmjs/asm_v_wasm.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/asmjs/asm_v_wasm.cpp b/src/asmjs/asm_v_wasm.cpp index 14a7fbdae..648871100 100644 --- a/src/asmjs/asm_v_wasm.cpp +++ b/src/asmjs/asm_v_wasm.cpp @@ -53,7 +53,7 @@ char getSig(WasmType type) { } } -std::string getSig(FunctionType *type) { +std::string getSig(const FunctionType *type) { std::string ret; ret += getSig(type->result); for (auto param : type->params) { |