From 22e06c81bbf5c6f717a1e4873725f9cc466dfbfc Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Fri, 9 Jun 2017 18:55:37 -0700 Subject: [PATCH 1/2] Output inf/-inf rather than infinity/-infinity wast2wasm wes recently updated to only support the former: https://github.com/WebAssembly/wabt/pull/482 --- src/wasm/literal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wasm/literal.cpp b/src/wasm/literal.cpp index 1cc08322077..d6d7848d0b3 100644 --- a/src/wasm/literal.cpp +++ b/src/wasm/literal.cpp @@ -145,7 +145,7 @@ void Literal::printDouble(std::ostream& o, double d) { return; } if (!std::isfinite(d)) { - o << (std::signbit(d) ? "-infinity" : "infinity"); + o << (std::signbit(d) ? "-inf" : "inf"); return; } const char* text = cashew::JSPrinter::numToString(d); From 07b104d9aefe4ccaf3a6452587cffde8232f783b Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Fri, 9 Jun 2017 19:23:28 -0700 Subject: [PATCH 2/2] update tests --- test/llvm_autogenerated/immediates.wast | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/llvm_autogenerated/immediates.wast b/test/llvm_autogenerated/immediates.wast index 9b471543375..6dce33aeb5d 100644 --- a/test/llvm_autogenerated/immediates.wast +++ b/test/llvm_autogenerated/immediates.wast @@ -105,12 +105,12 @@ ) (func $inf_f32 (result f32) (return - (f32.const infinity) + (f32.const inf) ) ) (func $neginf_f32 (result f32) (return - (f32.const -infinity) + (f32.const -inf) ) ) (func $custom_nan_f32 (result f32) @@ -155,12 +155,12 @@ ) (func $inf_f64 (result f64) (return - (f64.const infinity) + (f64.const inf) ) ) (func $neginf_f64 (result f64) (return - (f64.const -infinity) + (f64.const -inf) ) ) (func $custom_nan_f64 (result f64)