SwiftRemoteMirror: Fix crash emitting capture descriptors involving implicit self

When emitting capture descriptors for functions with a smaller number of parameters
than SIL parameters, the compiler can crash indexing into the heap layout's element
types, because the capture index underflows to UINT_MAX.

rdar://problem/26404583
This commit is contained in:
David Farler
2016-05-20 20:53:10 -07:00
parent dc4ff8c944
commit aa86d1dd07
3 changed files with 6 additions and 24 deletions

View File

@@ -629,8 +629,7 @@ public:
CanSILFunctionType origCalleeType,
CanSILFunctionType substCalleeType,
ArrayRef<Substitution> subs,
HeapLayout &layout,
unsigned firstCaptureIndex);
HeapLayout &layout);
std::string getBuiltinTypeMetadataSectionName();
std::string getFieldTypeMetadataSectionName();
std::string getAssociatedTypeMetadataSectionName();