Fixed parsing of "parameter integer"
authorClifford Wolf <clifford@clifford.at>
Wed, 13 Nov 2013 14:30:23 +0000 (15:30 +0100)
committerClifford Wolf <clifford@clifford.at>
Wed, 13 Nov 2013 14:30:23 +0000 (15:30 +0100)
frontends/verilog/parser.y

index 6669489876f06fb3905f63503f901df8f1e59e75..17f14d541bd628c336dae233b2642a37d9a9867d 100644 (file)
@@ -386,8 +386,8 @@ param_integer:
                if (astbuf1->children.size() != 1)
                        frontend_verilog_yyerror("Syntax error.");
                astbuf1->children.push_back(new AstNode(AST_RANGE));
-               astbuf1->children[0]->children.push_back(AstNode::mkconst_int(31, true));
-               astbuf1->children[0]->children.push_back(AstNode::mkconst_int(0, true));
+               astbuf1->children.back()->children.push_back(AstNode::mkconst_int(31, true));
+               astbuf1->children.back()->children.push_back(AstNode::mkconst_int(0, true));
        } | /* empty */;
 
 param_range: