From: Clifford Wolf Date: Sun, 29 Dec 2013 19:18:22 +0000 (+0100) Subject: Fixed a stupid access after delete bug X-Git-Tag: yosys-0.2.0~212 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=364f277afba815029be8b4bf67e68547080df859;p=yosys.git Fixed a stupid access after delete bug --- diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index 982d1ae35..9b8ed7603 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -497,8 +497,9 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage, if (width != int(children[0]->bits.size())) { RTLIL::SigSpec sig(children[0]->bits); sig.extend_u0(width, children[0]->is_signed); - delete children[0]; + AstNode *old_child_0 = children[0]; children[0] = mkconst_bits(sig.as_const().bits, children[0]->is_signed); + delete old_child_0; } children[0]->is_signed = is_signed; }