From: Clifford Wolf Date: Fri, 25 Sep 2015 10:38:01 +0000 (+0200) Subject: Fixed segfault in AstNode::asReal X-Git-Tag: yosys-0.6~133 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b2544cfcf77c3a7e923d05151a8e37b079559119;p=yosys.git Fixed segfault in AstNode::asReal --- diff --git a/frontends/ast/ast.cc b/frontends/ast/ast.cc index 5044eeabc..3e163bae7 100644 --- a/frontends/ast/ast.cc +++ b/frontends/ast/ast.cc @@ -831,7 +831,7 @@ double AstNode::asReal(bool is_signed) { RTLIL::Const val(bits); - bool is_negative = is_signed && val.bits.back() == RTLIL::State::S1; + bool is_negative = is_signed && !val.bits.empty() && val.bits.back() == RTLIL::State::S1; if (is_negative) val = const_neg(val, val, false, false, val.bits.size());