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 df42951d4..0ffca478b 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -122,6 +122,10 @@ struct Literal {
}
void printDouble(std::ostream &o, double d) {
+ if (d == 0 && 1/d < 0) {
+ o << "-0";
+ return;
+ }
const char *text = cashew::JSPrinter::numToString(d);
// spec interpreter hates floats starting with '.'
if (text[0] == '.') {