Iterate only if class extend exists

Signed-off-by: Pawel Kojma <pkojma@internships.antmicro.com>
This commit is contained in:
Pawel Kojma 2026-02-11 14:41:45 +01:00
parent 7d10e473df
commit ec2d9f9bd6
1 changed files with 1 additions and 1 deletions

View File

@ -2609,7 +2609,7 @@ public:
"T_Callable 'f' must have a signature compatible with 'void(AstClass*, T_Node*)', "
"with 'T_Node' being a subtype of 'AstNode'");
if (const AstClassExtends* const cextendsp = this->extendsp()) {
cextendsp->classp()->foreachMember(f);
if (cextendsp->classOrNullp()) cextendsp->classp()->foreachMember(f);
}
for (AstNode* stmtp = stmtsp(); stmtp; stmtp = stmtp->nextp()) {
if (AstNode::privateTypeTest<T_Node>(stmtp)) f(this, static_cast<T_Node*>(stmtp));