Skip to content

Commit

Permalink
Fix null pointer dereference in UhdmAst::process_net().
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariusz Glebocki committed Aug 19, 2023
1 parent 195cd50 commit ef52253
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion systemverilog-plugin/UhdmAst.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4774,7 +4774,9 @@ void UhdmAst::process_net()
current_node->is_logic = !current_node->is_reg;
current_node->is_signed = vpi_get(vpiSigned, obj_h);
visit_one_to_one({vpiTypespec}, obj_h, [&](AST::AstNode *node) {
if (node && !node->str.empty()) {
if (!node)
return;
if (!node->str.empty()) {
auto wiretype_node = new AST::AstNode(AST::AST_WIRETYPE);
wiretype_node->str = node->str;
// wiretype needs to be 1st node
Expand Down

0 comments on commit ef52253

Please sign in to comment.