Skip to content

Commit 3503ab3

Browse files
committed
Update assert to fix packs
1 parent a0c8465 commit 3503ab3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

stdlib/public/runtime/Demangle.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,10 @@ static bool _buildDemanglingForGenericArgs(
343343
auto packDescriptor = packDescriptors[packIndex];
344344
assert(packDescriptor.Kind == GenericPackKind::Metadata);
345345
assert(packDescriptor.ShapeClass < packHeader.NumShapeClasses);
346-
assert(packDescriptor.Index == argIndex);
346+
347+
// Arg index is not interested in the shape classes, but the pack
348+
// descriptor's index is in terms of the shape classes.
349+
assert(packDescriptor.Index == argIndex + packHeader.NumShapeClasses);
347350

348351
MetadataPackPointer pack(genericArg.getMetadataPack());
349352
size_t count = reinterpret_cast<size_t>(genericArgs[packDescriptor.ShapeClass]);

0 commit comments

Comments
 (0)