Skip to content

Commit 9e2d03e

Browse files
committed
[cxx-interop] Skip void types in emitCXXConstructorThunkIfNeeded.
emitCXXConstructorThunkIfNeeded receives a SIL function that may contain metatypes. If so, they will be converted to void and we need to skip them when emitting the thunk's args.
1 parent 7399c20 commit 9e2d03e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/IRGen/GenDecl.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2812,6 +2812,10 @@ emitCXXConstructorThunkIfNeeded(IRGenModule &IGM, SILFunction *initializer,
28122812
for (auto i = thunk->arg_begin(), e = thunk->arg_end(); i != e; ++i) {
28132813
auto *argTy = i->getType();
28142814
auto *paramTy = ctorFnType->getParamType(i - thunk->arg_begin());
2815+
// Thin metatypes are represented as "void". If we run across one of
2816+
// thesse, skip it.
2817+
if (paramTy == IGM.VoidTy)
2818+
continue;
28152819
if (paramTy != argTy)
28162820
Args.push_back(subIGF.coerceValue(i, paramTy, IGM.DataLayout));
28172821
else

0 commit comments

Comments
 (0)