[clang] [clang] Fix high memory consumption during pack deduction (PR #88637)

via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 13 21:35:41 PDT 2024


================
@@ -831,7 +831,7 @@ class PackDeductionScope {
     if (IsPartiallyExpanded)
       PackElements += NumPartialPackArgs;
     else if (IsExpanded)
-      PackElements += *FixedNumExpansions;
+      PackElements += FixedNumExpansions.value_or(1);
----------------
Sirraide wrote:

This seems fine as a fix, though ideally, it would be good to know what’s causing this so it’s easier to figure out what’s going wrong; my assumption is that we do something to the pack that causes `IsExpanded` to be true here but which wouldn’t have been true at the time `FixedNumExpansions` was (not) set.

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


More information about the cfe-commits mailing list