From e55d9454da30f7c44924809969741f8b7531e832 Mon Sep 17 00:00:00 2001 From: Cary R Date: Sun, 13 Jul 2025 19:37:27 -0700 Subject: [PATCH] Calling front() on an empty() list is undefined --- pform.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pform.cc b/pform.cc index 71962a830..e1d5221be 100644 --- a/pform.cc +++ b/pform.cc @@ -790,8 +790,8 @@ bool pform_in_interface() static bool pform_at_module_level() { - return (lexical_scope == pform_cur_module.front()) - || (lexical_scope == pform_cur_generate); + return (!pform_cur_module.empty() && (lexical_scope == pform_cur_module.front())) || + (lexical_scope == pform_cur_generate); } PWire*pform_get_wire_in_scope(perm_string name)