summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-12-05 14:57:10 -0800
committerAlon Zakai <alonzakai@gmail.com>2015-12-05 14:57:10 -0800
commit730c770784cc83922bcfdf43fe04064319d191d5 (patch)
tree4c0196fc0a19108ba1e2203715703f31b0094b2c
parent3ca8dd6de1093d67fd9eb76c6c0da823cf39c5a8 (diff)
downloadbinaryen-730c770784cc83922bcfdf43fe04064319d191d5.tar.gz
binaryen-730c770784cc83922bcfdf43fe04064319d191d5.tar.bz2
binaryen-730c770784cc83922bcfdf43fe04064319d191d5.zip
use breakResults in break
-rw-r--r--src/wasm2asm.h2
-rw-r--r--test/unit.2asm.js12
2 files changed, 7 insertions, 7 deletions
diff --git a/src/wasm2asm.h b/src/wasm2asm.h
index 4d5e4f2a8..3fd743dcf 100644
--- a/src/wasm2asm.h
+++ b/src/wasm2asm.h
@@ -511,7 +511,7 @@ Ref Wasm2AsmBuilder::processFunctionBody(Expression* curr, IString result) {
}
if (!curr->value) return theBreak;
// generate the value, including assigning to the result, and then do the break
- Ref ret = visitAndAssign(curr->value, result);
+ Ref ret = visitAndAssign(curr->value, breakResults[curr->name]);
ret = blockify(ret);
ret[1]->push_back(theBreak);
return ret;
diff --git a/test/unit.2asm.js b/test/unit.2asm.js
index b913c6957..210462773 100644
--- a/test/unit.2asm.js
+++ b/test/unit.2asm.js
@@ -15,11 +15,11 @@ function asmFunc() {
topmost : {
temp = +(+(+(HEAPF64[8 >> 3] + HEAPF64[16 >> 3]) + -HEAPF64[16 >> 3]) + -HEAPF64[8 >> 3]);
if ((HEAPU32[24 >> 2] | 0) > (0 | 0)) {
- wasm2asm$noresult = -3.4;
+ wasm2asm_f64$0 = -3.4;
break topmost;
};
if (HEAPF64[32 >> 3] > 0.0) {
- wasm2asm$noresult = 5.6;
+ wasm2asm_f64$0 = 5.6;
break topmost;
};
wasm2asm_f64$0 = 1.2;
@@ -33,19 +33,19 @@ function asmFunc() {
var t = 0.0, Int = 0.0, Double = 0, wasm2asm_f64$0 = 0.0;
topmost : {
if (x > 0.0) {
- wasm2asm$noresult = 1.2;
+ wasm2asm_f64$0 = 1.2;
break topmost;
};
if (Int > 0.0) {
- wasm2asm$noresult = -3.4;
+ wasm2asm_f64$0 = -3.4;
break topmost;
};
if ((Double | 0) > (0 | 0)) {
- wasm2asm$noresult = 5.6;
+ wasm2asm_f64$0 = 5.6;
break topmost;
};
if (x < y) {
- wasm2asm$noresult = x;
+ wasm2asm_f64$0 = x;
break topmost;
};
wasm2asm_f64$0 = y;