================
@@ -758,7 +758,19 @@ static bool isNullTermPointer(const Expr *Ptr, ASTContext 
&Ctx) {
   // Strip CXXDefaultArgExpr before check:
   if (const auto *DefaultArgE = dyn_cast<CXXDefaultArgExpr>(Ptr))
     Ptr = DefaultArgE->getExpr();
-  Ptr = tryConstantFoldConditionalExpr(Ptr, Ctx);
+  // Try to perform constant fold recursively:
+  if (const auto *NewPtr =
+          tryConstantFoldConditionalExpr(Ptr->IgnoreParenImpCasts(), Ctx);
+      NewPtr != Ptr)
+    return isNullTermPointer(NewPtr, Ctx);
----------------
ziqingluo-90 wrote:

You are right, it's bad! Though it works, because in the second 
recursion`Ptr->IgnoreParenImpCasts()` will do nothing.  But it is bad, I will 
fix it.

https://github.com/llvm/llvm-project/pull/176262
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to