瀏覽代碼

Fix assert in DeduceTemplateArgumentsForHLSL for extension method support

Tex Riddell 6 年之前
父節點
當前提交
47b75271d5
共有 1 個文件被更改,包括 5 次插入4 次删除
  1. 5 4
      tools/clang/lib/Sema/SemaHLSL.cpp

+ 5 - 4
tools/clang/lib/Sema/SemaHLSL.cpp

@@ -8983,11 +8983,12 @@ Sema::TemplateDeductionResult HLSLExternalSource::DeduceTemplateArgumentsForHLSL
   }
 
   // Find the table of intrinsics based on the object type.
-  const HLSL_INTRINSIC* intrinsics;
-  size_t intrinsicCount;
-  const char* objectName;
+  const HLSL_INTRINSIC* intrinsics = nullptr;
+  size_t intrinsicCount = 0;
+  const char* objectName = nullptr;
   FindIntrinsicTable(FunctionTemplate->getDeclContext(), &objectName, &intrinsics, &intrinsicCount);
-  DXASSERT(intrinsics != nullptr,
+  DXASSERT(objectName != nullptr &&
+    (intrinsics != nullptr || m_intrinsicTables.size() > 0),
     "otherwise FindIntrinsicTable failed to lookup a valid object, "
     "or the parser let a user-defined template object through");