[clang] [Clang] Initialize AtLeastAsSpecialized to prevent undefined behavior in Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs() (PR #95195)

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 11 22:16:50 PDT 2024


================
@@ -6447,7 +6447,7 @@ bool Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs(
   if (Inst.isInvalid())
     return false;
 
-  bool AtLeastAsSpecialized;
+  bool AtLeastAsSpecialized = false;
   runWithSufficientStackSpace(Info.getLocation(), [&] {
----------------
mizvekov wrote:

runWithSufficientStackSpace is a small helper used to prevent stack exhaustion.

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


More information about the cfe-commits mailing list