diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-12-05 19:40:30 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-12-05 19:40:30 -0800 |
commit | 4752e205dc84df8b41cd6dbc7282f85a38a89e8e (patch) | |
tree | 956b8f6628b75cba96747dbe0b622780c81484c9 /src/wasm2asm.h | |
parent | 2b38d9587a5dff98f918ccf7d1112e8db2b357fe (diff) | |
download | binaryen-4752e205dc84df8b41cd6dbc7282f85a38a89e8e.tar.gz binaryen-4752e205dc84df8b41cd6dbc7282f85a38a89e8e.tar.bz2 binaryen-4752e205dc84df8b41cd6dbc7282f85a38a89e8e.zip |
coerce call arguments in wasm2asm
Diffstat (limited to 'src/wasm2asm.h')
-rw-r--r-- | src/wasm2asm.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/wasm2asm.h b/src/wasm2asm.h index 606423e8e..f139b58dd 100644 --- a/src/wasm2asm.h +++ b/src/wasm2asm.h @@ -570,7 +570,7 @@ Ref Wasm2AsmBuilder::processFunctionBody(Expression* curr, IString result) { temps.emplace_back(operand->type, parent); IString temp = temps.back().temp; ret[1]->push_back(visitAndAssign(operand, temp)); - theCall[2]->push_back(ValueBuilder::makeName(temp)); + theCall[2]->push_back(makeAsmCoercion(ValueBuilder::makeName(temp), wasmToAsmType(operand->type))); } theCall = makeAsmCoercion(theCall, wasmToAsmType(type)); if (result != NO_RESULT) { @@ -585,7 +585,7 @@ Ref Wasm2AsmBuilder::processFunctionBody(Expression* curr, IString result) { if (!isStatement(curr)) { // none of our operands is a statement; go right ahead and create a simple expression for (auto operand : curr->operands) { - theCall[2]->push_back(visit(operand, EXPRESSION_RESULT)); + theCall[2]->push_back(makeAsmCoercion(visit(operand, EXPRESSION_RESULT), wasmToAsmType(operand->type))); } return makeAsmCoercion(theCall, wasmToAsmType(curr->type)); } @@ -600,7 +600,7 @@ Ref Wasm2AsmBuilder::processFunctionBody(Expression* curr, IString result) { // none of our operands is a statement; go right ahead and create a simple expression Ref theCall = ValueBuilder::makeCall(ValueBuilder::makeSub(ValueBuilder::makeName(FUNCTION_TABLE), visit(curr->target, EXPRESSION_RESULT))); for (auto operand : curr->operands) { - theCall[2]->push_back(visit(operand, EXPRESSION_RESULT)); + theCall[2]->push_back(makeAsmCoercion(visit(operand, EXPRESSION_RESULT), wasmToAsmType(operand->type))); } return makeAsmCoercion(theCall, wasmToAsmType(curr->type)); } |