Fix crash on non-class static function

This commit is contained in:
Wilson Snyder 2020-11-27 14:58:50 -05:00
parent cc307626c0
commit 123d1af29d
1 changed files with 2 additions and 2 deletions

View File

@ -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));
}
}