Skip to content

Commit 14d7572

Browse files
authored
Add check for nullptr dereference in process_port (#2687)
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.
2 parents 90f3a82 + e780935 commit 14d7572

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/frontends/systemverilog/uhdm_ast.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4998,6 +4998,8 @@ void UhdmAst::process_port()
49984998
std::vector<AST::AstNode *> unpacked_ranges; // comes after wire name
49994999
if (lowConn_h) {
50005000
vpiHandle actual_h = vpi_handle(vpiActual, lowConn_h);
5001+
if (!actual_h)
5002+
log_error("vpiPort doesn't contain vpiActual in it's subtree. Aborting.\n");
50015003
auto actual_type = vpi_get(vpiType, actual_h);
50025004
switch (actual_type) {
50035005
case vpiModport: {

0 commit comments

Comments
 (0)