We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents fa82965 + f14df42 commit 2c2448fCopy full SHA for 2c2448f
lib/IRGen/GenFunc.cpp
@@ -1437,11 +1437,8 @@ void irgen::emitFunctionPartialApplication(
1437
if (isIndirectFormalParameter(*singleRefcountedConvention))
1438
ctx = IGF.Builder.CreateLoad(ctx, IGF.IGM.getPointerAlignment());
1439
// We might get a struct containing a pointer e.g type <{ %AClass* }>
1440
- if (!ctx->getType()->isPointerTy())
1441
- ctx = IGF.coerceValue(ctx, IGF.IGM.RefCountedPtrTy,
1442
- IGF.IGM.DataLayout);
1443
- else
1444
- ctx = IGF.Builder.CreateBitCast(ctx, IGF.IGM.RefCountedPtrTy);
+ if (ctx->getType() != IGF.IGM.RefCountedPtrTy)
+ ctx = IGF.coerceValue(ctx, IGF.IGM.RefCountedPtrTy, IGF.IGM.DataLayout);
1445
out.add(ctx);
1446
return;
1447
}
0 commit comments