Fixed segfault in AstNode::asReal

This commit is contained in:
Clifford Wolf 2015-09-25 12:38:01 +02:00
parent 924d9d6e86
commit b2544cfcf7
1 changed files with 1 additions and 1 deletions

View File

@ -831,7 +831,7 @@ double AstNode::asReal(bool is_signed)
{ {
RTLIL::Const val(bits); 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) if (is_negative)
val = const_neg(val, val, false, false, val.bits.size()); val = const_neg(val, val, false, false, val.bits.size());