summaryrefslogtreecommitdiff
path: root/frontends/ast/simplify.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-12-29 20:18:22 +0100
committerClifford Wolf <clifford@clifford.at>2013-12-29 20:18:22 +0100
commit364f277afba815029be8b4bf67e68547080df859 (patch)
tree2a656d9fded5b6b34941f8af3b9eee1a66640c84 /frontends/ast/simplify.cc
parentbf607df6d57c3976880004192129eff8b1c0d0a9 (diff)
Fixed a stupid access after delete bug
Diffstat (limited to 'frontends/ast/simplify.cc')
-rw-r--r--frontends/ast/simplify.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc
index 982d1ae3..9b8ed760 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;
}