verilog: fix #2037 by permitting (and freeing) attributes on null stmt

This commit is contained in:
Eddie Hung 2020-05-11 09:33:19 -07:00
parent 589775538c
commit d21a07c7b5
1 changed files with 5 additions and 1 deletions

View File

@ -2228,7 +2228,11 @@ simple_behavioral_stmt:
behavioral_stmt:
defattr | assert | wire_decl | param_decl | localparam_decl | typedef_decl |
non_opt_delay behavioral_stmt |
attr simple_behavioral_stmt ';' | ';' |
attr simple_behavioral_stmt ';' |
attr ';' {
log_file_warning(current_filename, get_line_num(), "Attribute(s) attached to null statement. Ignoring.\n");
free_attr($1);
} |
attr hierarchical_id {
AstNode *node = new AstNode(AST_TCALL);
node->str = *$2;