================
@@ -1691,10 +1691,15 @@ ThreadSafetyAnalyzer::getTerminatorTrylockCall(const 
CFGBlock *Block,
   assert(!Negate && "Must be called with Negate initialized to false");
 
   const Stmt *Cond = Block->getTerminatorCondition();
-  // We don't acquire try-locks on ?: branches, only when its result is used.
-  if (!Cond || isa<ConditionalOperator>(Block->getTerminatorStmt()))
+  if (!Cond)
     return {};
 
+  // We don't acquire try-locks on ?: branches, except when its result is used.
+  if (const auto *COp =
+          dyn_cast_if_present<ConditionalOperator>(Block->getTerminatorStmt()))
----------------
aaronpuchert wrote:

Why change from `isa` to `dyn_cast_if_present`? Did you observe any cases where 
the terminator is null?

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

Reply via email to