From 123d1af29de0e4b6c97ff670e16538908086f619 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Fri, 27 Nov 2020 14:58:50 -0500 Subject: [PATCH] Fix crash on non-class static function --- src/V3Class.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/V3Class.cpp b/src/V3Class.cpp index 529a7e15b..83f99724a 100644 --- a/src/V3Class.cpp +++ b/src/V3Class.cpp @@ -100,7 +100,7 @@ private: iterateChildren(nodep); // Don't move now, or wouldn't keep interating the class // TODO move class statics too - if (m_ftaskp && m_ftaskp->lifetime().isStatic()) { + if (m_packageScopep && m_ftaskp && m_ftaskp->lifetime().isStatic()) { m_moves.push_back(make_pair(nodep, m_packageScopep)); } } @@ -115,7 +115,7 @@ private: { m_ftaskp = nodep; iterateChildren(nodep); - if (nodep->lifetime().isStatic()) { + if (m_packageScopep && nodep->lifetime().isStatic()) { m_moves.push_back(make_pair(nodep, m_packageScopep)); } }