From 12fa085b26dd6aed5d25281a7732da7238b101b7 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Mon, 30 Sep 2019 19:22:14 -0400 Subject: [PATCH] Fix misc bad-syntax crashes, bug1529. --- Changes | 2 +- src/verilog.y | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index 2f0c32823..6f43b38a6 100644 --- a/Changes +++ b/Changes @@ -22,7 +22,7 @@ The contributors that suggested a given feature are shown in []. Thanks! **** Fix ugly error on interface misuse, bug1525. [Bogdan Vukobratovic] -**** Fix misc bad-syntax crashes, bug1532. [Eric Rippey] +**** Fix misc bad-syntax crashes, bug1529, bug1532. [Eric Rippey] * Verilator 4.018 2019-08-29 diff --git a/src/verilog.y b/src/verilog.y index bb2dc844c..06a99cb05 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -2694,7 +2694,7 @@ patternList: // IEEE: part of pattern ; patternOne: // IEEE: part of pattern - expr { $$ = new AstPatMember($1->fileline(),$1,NULL,NULL); } + expr { if ($1) { $$ = new AstPatMember($1->fileline(),$1,NULL,NULL); } else { $$=NULL; } } | expr '{' argsExprList '}' { $$ = new AstPatMember($2,$3,NULL,$1); } | patternNoExpr { $$ = $1; } ;