Fix memory leak for unsupported `$past` (#6535)

Signed-off-by: Bartłomiej Chmiel <bchmiel@antmicro.com>
This commit is contained in:
Bartłomiej Chmiel 2025-10-07 15:56:11 +02:00 committed by GitHub
parent d7fbea62f9
commit 888169571b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -4357,9 +4357,11 @@ system_f_call_or_t<nodeExprp>: // 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}; }