aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/ast
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-12-18 17:49:38 +0100
committerClifford Wolf <clifford@clifford.at>2018-12-18 17:49:38 +0100
commitfdf7c421810e8718f7ee312ddd3cfdbfb65aa2ce (patch)
tree463596096e15fc18aaa9c77073434fc546578cb5 /frontends/ast
parent3d671630e2bf78cd53ef1b678a1bbb63338cbcd2 (diff)
downloadyosys-fdf7c421810e8718f7ee312ddd3cfdbfb65aa2ce.tar.gz
yosys-fdf7c421810e8718f7ee312ddd3cfdbfb65aa2ce.tar.bz2
yosys-fdf7c421810e8718f7ee312ddd3cfdbfb65aa2ce.zip
Fix segfault in AST simplify
(as proposed by Dan Gisselquist) Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'frontends/ast')
-rw-r--r--frontends/ast/simplify.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc
index 55abe165f..83714f897 100644
--- a/frontends/ast/simplify.cc
+++ b/frontends/ast/simplify.cc
@@ -1810,6 +1810,11 @@ skip_dynamic_range_lvalue_expansion:;
log_assert(block != nullptr);
+ if (num_steps == 0) {
+ newNode = children[0]->clone();
+ goto apply_newNode;
+ }
+
int myidx = autoidx++;
AstNode *outreg = nullptr;