File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1032,8 +1032,11 @@ void IRGenDebugInfo::emitVariableDeclaration(
1032
1032
if (IsPiece) {
1033
1033
// Try to get the size from the type if possible.
1034
1034
auto StorageSize = getSizeFromExplosionValue (CI.getTargetInfo (), Piece);
1035
- assert ((Dim.SizeInBits != 0 || StorageSize != 0 ) &&
1036
- " zero-sized variable with nonzero storage size" );
1035
+ // FIXME: The TypeInfo for bound generic enum types reports a
1036
+ // type <{}> (with size 0) but a concrete instance may still
1037
+ // have storage allocated for it. rdar://problem/21470869
1038
+ if (!Dim.SizeInBits || (StorageSize && Dim.SizeInBits > StorageSize))
1039
+ Dim.SizeInBits = StorageSize;
1037
1040
1038
1041
// FIXME: Occasionally we miss out that the Storage is actually a
1039
1042
// refcount wrapper. Silently skip these for now.
You can’t perform that action at this time.
0 commit comments