[clang] [Clang] Prevent potential null pointer dereferences (PR #117176)

via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 21 07:51:15 PST 2024


================
@@ -1908,9 +1908,9 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
       return true;
     // ensure both args have 3 elements
     int NumElementsArg1 =
-        TheCall->getArg(0)->getType()->getAs<VectorType>()->getNumElements();
+        TheCall->getArg(0)->getType()->casAs<VectorType>()->getNumElements();
----------------
smanna12 wrote:

Done

https://github.com/llvm/llvm-project/pull/117176


More information about the cfe-commits mailing list