From 8ab100c1c7e8e72743505e5c691c842933db4447 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Fri, 21 Apr 2017 21:37:17 +0100 Subject: [PATCH] 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 8a5cbd441583f6b24918d9b0f846a74d4f2c9cf1) --- pform.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pform.cc b/pform.cc index 1fd04e6c5..14eb57a48 100644 --- a/pform.cc +++ b/pform.cc @@ -2138,9 +2138,11 @@ static void pform_makegate(PGBuiltin::Type type, return; } - for (list::iterator cur = info.parms->begin() - ; cur != info.parms->end() ; ++cur) { - pform_declare_implicit_nets(*cur); + if (info.parms) { + for (list::iterator cur = info.parms->begin() + ; cur != info.parms->end() ; ++cur) { + pform_declare_implicit_nets(*cur); + } } perm_string dev_name = lex_strings.make(info.name);