projects
/
yosys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
924d9d6
)
Fixed segfault in AstNode::asReal
author
Clifford Wolf
<clifford@clifford.at>
Fri, 25 Sep 2015 10:38:01 +0000
(12:38 +0200)
committer
Clifford Wolf
<clifford@clifford.at>
Fri, 25 Sep 2015 10:38:01 +0000
(12:38 +0200)
frontends/ast/ast.cc
patch
|
blob
|
history
diff --git
a/frontends/ast/ast.cc
b/frontends/ast/ast.cc
index 5044eeabcbb1b70aa6e05d78a37e959d99e86904..3e163bae799ca649dfb3980fe2d09f2e9d81a741 100644
(file)
--- 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());