summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wasm-s-parser.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h
index c907f51f1..fc45571be 100644
--- a/src/wasm-s-parser.h
+++ b/src/wasm-s-parser.h
@@ -714,6 +714,8 @@ private:
uint32_t pattern;
float f;
} u;
+ std::istringstream istr(str);
+ istr >> std::hex >> u.pattern;
u.pattern = atoi(str + 6);
u.pattern |= 0x7f800000;
assert(isnan(u.f));
@@ -725,7 +727,8 @@ private:
uint64_t pattern;
double d;
} u;
- u.pattern = atol(str + 6);
+ std::istringstream istr(str);
+ istr >> std::hex >> u.pattern;
u.pattern |= 0x7ff0000000000000LL;
assert(isnan(u.d));
ret->value.f64 = u.d;