diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-12-05 11:52:57 -0500 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-12-05 11:52:57 -0500 |
commit | 9932b38a5e807964d7b64b8714c43bbe345bd267 (patch) | |
tree | 0474b0c12a063ee0a2838738d597d0bf4dbab478 | |
parent | 3a18259bcd476be655b72309190aa1a7a932c241 (diff) |
handle return values for library calls using aliases with different return types
-rw-r--r-- | src/jsifier.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 0e6198c0..907855e7 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -1604,6 +1604,15 @@ function JSify(data, functionsOnly, givenFunctions) { } } + // we alias llvm memset and such to normal memset. The target has a return value, while the original + // does not, so we need to fix that for the actual call target + if (ASM_JS) { + var sig = LibraryManager.library[simpleIdent + '__sig']; + if (sig && sig[0] !== 'v') { + returnType = Functions.getSignatureType(sig[0]); + } + } + if (byPointer) { var sig = Functions.getSignature(returnType, argsTypes, hasVarArgs); if (ASM_JS) { |