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.

(cherry picked from commit 8a5cbd4415)
This commit is contained in:
Martin Whitaker 2017-04-21 21:37:17 +01:00
parent 177ae7c220
commit 8ab100c1c7
1 changed files with 5 additions and 3 deletions

View File

@ -2138,9 +2138,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);