diff options
Diffstat (limited to 'src/wasm-s-parser.h')
-rw-r--r-- | src/wasm-s-parser.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index 26abdec8e..81c0e73b4 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -33,7 +33,8 @@ IString MODULE("module"), CALL_IMPORT("call_import"), CALL_INDIRECT("call_indirect"), INFINITY_("infinity"), - NEG_INFINITY("-infinity"); + NEG_INFINITY("-infinity"), + NAN_("nan"); // // An element in an S-Expression: a list or a string @@ -517,6 +518,14 @@ private: } return ret; } + if (s[1]->str() == NAN_) { + switch (type) { + case f32: ret->value.f32 = std::nan(""); break; + case f64: ret->value.f64 = std::nan(""); break; + default: abort(); + } + return ret; + } } const char *str = s[1]->c_str(); std::istringstream istr(str); |