diff options
Diffstat (limited to 'frontends/ast/ast.cc')
-rw-r--r-- | frontends/ast/ast.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/frontends/ast/ast.cc b/frontends/ast/ast.cc index 2fc8f9835..1e43875ae 100644 --- a/frontends/ast/ast.cc +++ b/frontends/ast/ast.cc @@ -844,7 +844,11 @@ RTLIL::Const AstNode::realAsConst(int width) { double v = round(realvalue); RTLIL::Const result; +#ifdef EMSCRIPTEN + if (!isfinite(v)) { +#else if (!std::isfinite(v)) { +#endif result.bits = std::vector<RTLIL::State>(width, RTLIL::State::Sx); } else { bool is_negative = v < 0; |