Skip to content

Commit

Permalink
Add check for nullptr dereference in process_port (#2687)
Browse files Browse the repository at this point in the history
This PR fixes segmentation fault seen in this issue:
chipsalliance/Surelog#4017, but it doesn't fix
the actual problem with missing `vpiActual` in UHDM tree.
  • Loading branch information
tgorochowik authored Nov 29, 2024
2 parents 90f3a82 + e780935 commit 14d7572
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/frontends/systemverilog/uhdm_ast.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4998,6 +4998,8 @@ void UhdmAst::process_port()
std::vector<AST::AstNode *> unpacked_ranges; // comes after wire name
if (lowConn_h) {
vpiHandle actual_h = vpi_handle(vpiActual, lowConn_h);
if (!actual_h)
log_error("vpiPort doesn't contain vpiActual in it's subtree. Aborting.\n");
auto actual_type = vpi_get(vpiType, actual_h);
switch (actual_type) {
case vpiModport: {
Expand Down

0 comments on commit 14d7572

Please sign in to comment.