From 888169571bd9e7d9544a8589c92acb6284419374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Chmiel?= Date: Tue, 7 Oct 2025 15:56:11 +0200 Subject: [PATCH] Fix memory leak for unsupported `$past` (#6535) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bartłomiej Chmiel --- src/verilog.y | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/verilog.y b/src/verilog.y index 768db997a..002f14db7 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -4357,9 +4357,11 @@ system_f_call_or_t: // IEEE: part of system_tf_call (can be task | yD_PAST '(' expr ',' exprE ')' { $$ = new AstPast{$1, $3, $5}; } | yD_PAST '(' expr ',' exprE ',' exprE ')' { if ($7) BBUNSUP($1, "Unsupported: $past expr2 and/or clock arguments"); + DEL($7); $$ = new AstPast{$1, $3, $5}; } | yD_PAST '(' expr ',' exprE ',' exprE ',' clocking_eventE ')' { if ($7 || $9) BBUNSUP($1, "Unsupported: $past expr2 and/or clock arguments"); + DEL($7, $9); $$ = new AstPast{$1, $3, $5}; } | yD_PAST_GCLK '(' expr ')' { $$ = new AstPast{$1, $3, nullptr, GRAMMARP->createGlobalClockSenTree($1)}; } | yD_POW '(' expr ',' expr ')' { $$ = new AstPowD{$1, $3, $5}; }