verilog: fix #2037 by permitting (and freeing) attributes on null stmt
authorEddie Hung <eddie@fpgeh.com>
Mon, 11 May 2020 16:33:19 +0000 (09:33 -0700)
committerEddie Hung <eddie@fpgeh.com>
Mon, 25 May 2020 14:36:53 +0000 (07:36 -0700)
frontends/verilog/verilog_parser.y

index d39b725473527d3454bc77ae4128e079b4900b9b..a0250439edb36b1c9f3f8785b547cecb5dfb44d2 100644 (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;