projects
/
yosys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e2e092b
)
Fixed AstNode::mkconst_bits() segfault on zero-sized constant
author
Clifford Wolf
<clifford@clifford.at>
Thu, 24 Sep 2015 09:21:20 +0000
(11:21 +0200)
committer
Clifford Wolf
<clifford@clifford.at>
Thu, 24 Sep 2015 09:21:20 +0000
(11:21 +0200)
frontends/ast/ast.cc
patch
|
blob
|
history
diff --git
a/frontends/ast/ast.cc
b/frontends/ast/ast.cc
index a4585915736c84f23b0f08a83d04861b01a2fe2a..5044eeabcbb1b70aa6e05d78a37e959d99e86904 100644
(file)
--- a/
frontends/ast/ast.cc
+++ b/
frontends/ast/ast.cc
@@
-699,7
+699,7
@@
AstNode *AstNode::mkconst_bits(const std::vector<RTLIL::State> &v, bool is_signe
for (size_t i = 0; i < 32; i++) {
if (i < node->bits.size())
node->integer |= (node->bits[i] == RTLIL::S1) << i;
- else if (is_signed)
+ else if (is_signed
&& !node->bits.empty()
)
node->integer |= (node->bits.back() == RTLIL::S1) << i;
}
node->range_valid = true;