From 15702f1b8707f21c23a2e4663bbcacbe3b2025ac Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Fri, 28 Nov 2008 10:00:57 -0800 Subject: [PATCH] Fix bad memory reference. The expression for the repeat expression was deleted before the tests for expression sanity. --- elab_net.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/elab_net.cc b/elab_net.cc index 1a01e8057..96a2cbbf1 100644 --- a/elab_net.cc +++ b/elab_net.cc @@ -1320,9 +1320,9 @@ NetNet* PEConcat::elaborate_net(Design*des, NetScope*scope, unsigned repeat = 1; if (repeat_) { - NetExpr*etmp = elab_and_eval(des, scope, repeat_); - assert(etmp); - NetEConst*erep = dynamic_cast(etmp); + auto_ptr etmp (elab_and_eval(des, scope, repeat_)); + assert(etmp.get()); + NetEConst*erep = dynamic_cast(etmp.get()); if (erep == 0) { cerr << get_line() << ": internal error: Unable to " @@ -1332,7 +1332,6 @@ NetNet* PEConcat::elaborate_net(Design*des, NetScope*scope, } repeat = erep->value().as_ulong(); - delete etmp; if (repeat == 0) { cerr << get_line() << ": error: Concatenation repeat "