3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-19 19:02:04 +00:00

Revert "verilog: fix parser "if" memory errors."

This reverts commit 34a2abeddb.
This commit is contained in:
Emil J. Tywoniak 2025-07-10 21:13:28 +02:00
parent dfe86b50d8
commit e0822c048e

View file

@ -2874,7 +2874,6 @@ behavioral_stmt:
} |
if_attr TOK_IF '(' expr ')' {
AstNode *node = 0;
AstNode *block = new AstNode(AST_BLOCK);
AstNode *context = ast_stack.back();
if (context && context->type == AST_BLOCK && context->get_bool_attribute(ID::promoted_if)) {
AstNode *outer = ast_stack[ast_stack.size() - 2];
@ -2883,10 +2882,8 @@ behavioral_stmt:
// parallel "else if": append condition to outer "if"
node = outer;
log_assert (node->children.size());
ast_stack.pop_back();
delete node->children.back();
node->children.pop_back();
ast_stack.push_back(block);
} else if (outer->get_bool_attribute(ID::full_case))
(*$1)[ID::full_case] = AstNode::mkconst_int(1, false);
}
@ -2897,8 +2894,8 @@ behavioral_stmt:
append_attr(node, $1);
ast_stack.back()->children.push_back(node);
node->children.push_back(node->get_bool_attribute(ID::parallel_case) ? AstNode::mkconst_int(1, false, 1) : expr);
} else
free_attr($1);
}
AstNode *block = new AstNode(AST_BLOCK);
AstNode *cond = new AstNode(AST_COND, node->get_bool_attribute(ID::parallel_case) ? expr : AstNode::mkconst_int(1, false, 1), block);
SET_AST_NODE_LOC(cond, @4, @4);
node->children.push_back(cond);