summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wasm.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wasm.h b/src/wasm.h
index 399e58cfe..e3724c612 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -213,6 +213,10 @@ struct Literal {
o << "nan:" << std::hex << u.ll << std::dec;
return;
}
+ if (!std::isfinite(d)) {
+ o << (d < 0 ? "-infinity" : "infinity");
+ return;
+ }
const char *text = cashew::JSPrinter::numToString(d);
// spec interpreter hates floats starting with '.'
if (text[0] == '.') {