diff --git a/gen/passes/GarbageCollect2Stack.cpp b/gen/passes/GarbageCollect2Stack.cpp index d8f974c8..055b08b1 100644 --- a/gen/passes/GarbageCollect2Stack.cpp +++ b/gen/passes/GarbageCollect2Stack.cpp @@ -167,10 +167,6 @@ bool GarbageCollect2Stack::runOnFunction(Function &F) { DEBUG(DOUT << "GarbageCollect2Stack inspecting: " << *Inst); - if (PointerMayBeCaptured(Inst, true)) { - continue; - } - Value* TypeInfo = CS.getArgument(info->TypeInfoArgNr); const Type* Ty = getTypeFor(TypeInfo); if (!Ty) { @@ -203,6 +199,10 @@ bool GarbageCollect2Stack::runOnFunction(Function &F) { Ty = PtrTy->getElementType(); } + if (PointerMayBeCaptured(Inst, true)) { + continue; + } + // Let's alloca this! Changed = true;