summaryrefslogtreecommitdiff
path: root/src/wasm-interpreter.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-interpreter.h')
-rw-r--r--src/wasm-interpreter.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h
index a22a631b1..f72dc524e 100644
--- a/src/wasm-interpreter.h
+++ b/src/wasm-interpreter.h
@@ -361,6 +361,7 @@ public:
case WrapInt64: return Flow(Literal(int32_t(value.geti64())));
case TruncSFloat32: {
float val = value.getf32();
+ if (isnan(val)) instance.externalInterface->trap();
if (val > (double)INT_MAX || val < (double)INT_MIN) instance.externalInterface->trap();
return Flow(Literal(int32_t(val)));
}