diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-11-17 16:26:40 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-11-17 16:26:40 -0800 |
commit | d48bd66a54633f94b7c499c490660280ac77c6e7 (patch) | |
tree | 62bbb98931d6a6799c55e95052f679433478d52e | |
parent | c93a347a702e556c3ccbc517fe048577fe347e01 (diff) | |
download | binaryen-d48bd66a54633f94b7c499c490660280ac77c6e7.tar.gz binaryen-d48bd66a54633f94b7c499c490660280ac77c6e7.tar.bz2 binaryen-d48bd66a54633f94b7c499c490660280ac77c6e7.zip |
refine trap texts
-rw-r--r-- | src/wasm-interpreter.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h index 662c884c1..fe84da315 100644 --- a/src/wasm-interpreter.h +++ b/src/wasm-interpreter.h @@ -619,11 +619,11 @@ private: double val = curr->op == TruncSFloat32 ? value.getf32() : value.getf64(); if (isnan(val)) trap("truncSFloat of nan"); if (curr->type == i32) { - if (val > (double)INT_MAX || val < (double)INT_MIN) trap("truncSFloat overflow"); + if (val > (double)INT_MAX || val < (double)INT_MIN) trap("i32.truncSFloat overflow"); return Literal(int32_t(val)); } else { int64_t converted = val; - if ((val >= 1 && converted <= 0) || val < (double)LLONG_MIN) trap("truncSFloat overflow"); + if ((val >= 1 && converted <= 0) || val < (double)LLONG_MIN) trap("i32.truncSFloat overflow"); return Literal(converted); } } @@ -632,11 +632,11 @@ private: double val = curr->op == TruncUFloat32 ? value.getf32() : value.getf64(); if (isnan(val)) trap("truncUFloat of nan"); if (curr->type == i32) { - if (val > (double)UINT_MAX || val <= (double)-1) trap("truncUFloat overflow"); + if (val > (double)UINT_MAX || val <= (double)-1) trap("i64.truncUFloat overflow"); return Literal(uint32_t(val)); } else { uint64_t converted = val; - if (converted < val - 1 || val <= (double)-1) trap("truncUFloat overflow"); + if (converted < val - 1 || val <= (double)-1) trap("i64.truncUFloat overflow"); return Literal(converted); } } |