From 2fc279ed7e106a01aa0529ead93dc3f04af8e77c Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sun, 20 Mar 2016 14:39:52 -0700 Subject: fix float to int trap text --- src/wasm-interpreter.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h index eca91fc82..e9ced6b6f 100644 --- a/src/wasm-interpreter.h +++ b/src/wasm-interpreter.h @@ -631,7 +631,7 @@ private: return Literal(int32_t(val)); } else { int64_t converted = val; - if ((val >= 1 && converted <= 0) || val < (double)LLONG_MIN) trap("i32.truncSFloat overflow"); + if ((val >= 1 && converted <= 0) || val < (double)LLONG_MIN) trap("i64.truncSFloat overflow"); return Literal(converted); } } @@ -640,7 +640,7 @@ private: double val = value.getFloat(); if (isnan(val)) trap("truncUFloat of nan"); if (curr->type == i32) { - if (val > (double)std::numeric_limits::max() || val <= (double)-1) trap("i64.truncUFloat overflow"); + if (val > (double)std::numeric_limits::max() || val <= (double)-1) trap("i32.truncUFloat overflow"); return Literal(uint32_t(val)); } else { uint64_t converted = val; -- cgit v1.2.3