Fix for GitHub issue #152 - segfault on gate connection syntax error.

If there is a syntax error in the source code, pform_makegate may be
passed a null list of port connections. The error is already reported,
so we just need to ignore it.
This commit is contained in:
Martin Whitaker 2017-04-21 21:37:17 +01:00
parent 0f57cceecc
commit 8a5cbd4415
1 changed files with 5 additions and 3 deletions

View File

@ -2142,9 +2142,11 @@ static void pform_makegate(PGBuiltin::Type type,
return;
}
for (list<PExpr*>::iterator cur = info.parms->begin()
; cur != info.parms->end() ; ++cur) {
pform_declare_implicit_nets(*cur);
if (info.parms) {
for (list<PExpr*>::iterator cur = info.parms->begin()
; cur != info.parms->end() ; ++cur) {
pform_declare_implicit_nets(*cur);
}
}
perm_string dev_name = lex_strings.make(info.name);