diff --git a/flang/lib/Semantics/expression.cpp b/flang/lib/Semantics/expression.cpp index 06226f282c1cd..cec936c8f5e42 100644 --- a/flang/lib/Semantics/expression.cpp +++ b/flang/lib/Semantics/expression.cpp @@ -2518,12 +2518,12 @@ auto ExpressionAnalyzer::GetCalleeAndArguments(const parser::Name &name, mightBeStructureConstructor)}; resolution = pair.first; dueToAmbiguity = pair.second; - if (context_.GetPPCBuiltinsScope() && - resolution->name().ToString().rfind("__ppc_", 0) == 0) { - semantics::CheckPPCIntrinsic( - *symbol, *resolution, arguments, GetFoldingContext()); - } if (resolution) { + if (context_.GetPPCBuiltinsScope() && + resolution->name().ToString().rfind("__ppc_", 0) == 0) { + semantics::CheckPPCIntrinsic( + *symbol, *resolution, arguments, GetFoldingContext()); + } // re-resolve name to the specific procedure name.symbol = const_cast(resolution); }