diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-03-28 18:10:46 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-03-28 18:10:46 -0700 |
commit | 5c1d36fb66b5aad63b02ab44433af201d22eebe0 (patch) | |
tree | de469d720c58c07ed1f83e65c3455a2964498830 /src/wasm-interpreter.h | |
parent | 68e15c423d92dd69138702cc572e503a33b31782 (diff) | |
parent | cefb6b6e05c985524e885af17160b9e146f9b088 (diff) | |
download | binaryen-5c1d36fb66b5aad63b02ab44433af201d22eebe0.tar.gz binaryen-5c1d36fb66b5aad63b02ab44433af201d22eebe0.tar.bz2 binaryen-5c1d36fb66b5aad63b02ab44433af201d22eebe0.zip |
Merge branch 'vs2015_fixes' of https://github.com/juj/binaryen into vs2015_fixes
Conflicts:
src/support/safe_integer.cpp
Diffstat (limited to 'src/wasm-interpreter.h')
-rw-r--r-- | src/wasm-interpreter.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h index 9aadccb59..e7a5d6d14 100644 --- a/src/wasm-interpreter.h +++ b/src/wasm-interpreter.h @@ -283,7 +283,7 @@ private: if (curr->condition) { Flow conditionFlow = visit(curr->condition); if (conditionFlow.breaking()) return conditionFlow; - condition = conditionFlow.value.getInteger(); + condition = conditionFlow.value.getInteger() != 0; } return condition ? flow : Flow(); } @@ -304,7 +304,7 @@ private: Name target = curr->default_; if (index >= 0 && (size_t)index < curr->targets.size()) { - target = curr->targets[index]; + target = curr->targets[(size_t)index]; } flow.breakTo = target; return flow; @@ -641,7 +641,7 @@ private: if (val > (double)std::numeric_limits<int32_t>::max() || val < (double)std::numeric_limits<int32_t>::min()) trap("i32.truncSFloat overflow"); return Literal(int32_t(val)); } else { - int64_t converted = val; + int64_t converted = (int64_t)val; if ((val >= 1 && converted <= 0) || val < (double)LLONG_MIN) trap("i64.truncSFloat overflow"); return Literal(converted); } @@ -654,7 +654,7 @@ private: if (val > (double)std::numeric_limits<uint32_t>::max() || val <= (double)-1) trap("i32.truncUFloat overflow"); return Literal(uint32_t(val)); } else { - uint64_t converted = val; + uint64_t converted = (uint64_t)val; if (converted < val - 1 || val <= (double)-1) trap("i64.truncUFloat overflow"); return Literal(converted); } @@ -695,7 +695,7 @@ private: template <class LS> size_t getFinalAddress(LS* curr, Literal ptr) { - auto trapIfGt = [this](size_t lhs, size_t rhs, const char* msg) { + auto trapIfGt = [this](uint64_t lhs, uint64_t rhs, const char* msg) { if (lhs > rhs) { std::stringstream ss; ss << msg << ": " << lhs << " > " << rhs; |