From 416bd35f2ef7127f5c60aef23d21c201fc760a2c Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Wed, 12 Nov 2008 22:42:13 +0000 Subject: [PATCH] Fix for leak in thread vector allocation. In the vvp code generator, when zero/sign extending a sub-expression, the sub-expression is first evaluated and stored in one location in the thread vector store, then is copied and extended into a second location. The storage used for the initial sub-expression evaluation is never deallocated. --- tgt-vvp/eval_expr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tgt-vvp/eval_expr.c b/tgt-vvp/eval_expr.c index 5108d16ee..a80ea872e 100644 --- a/tgt-vvp/eval_expr.c +++ b/tgt-vvp/eval_expr.c @@ -1823,6 +1823,8 @@ static struct vector_info draw_pad_expr(ivl_expr_t exp, unsigned wid) fprintf(vvp_out, " %%mov %u, 0, %u;\n", res.base+subv.wid, res.wid - subv.wid); } + if (subv.base >= 8) + clr_vector(subv); save_expression_lookaside(res.base, exp, wid); return res;