From: Clifford Wolf Date: Tue, 18 Dec 2018 16:49:38 +0000 (+0100) Subject: Fix segfault in AST simplify X-Git-Tag: yosys-0.9~364 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fdf7c421810e8718f7ee312ddd3cfdbfb65aa2ce;p=yosys.git Fix segfault in AST simplify (as proposed by Dan Gisselquist) Signed-off-by: Clifford Wolf --- 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;