Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit ee5ab84

Browse files
authored
Insert int3 after non-returning calls at the end of basic blocks. (#17535)
This is a follow-up to #17501 that fixed #17398. gc pointer reporting in fully-interruptible mode: the latter assumed that register gc pointer liveness doesn't change across calls while #6103 introduced codegen where it wasn't true. doesn't change across calls. This change inserts int3 after non-returning calls at the end of basic blocks so that gc pointer liveness doesn't change across calls. This is additional insurance in case any other place in the runtime is dependent on that contract.
1 parent 3db8384 commit ee5ab84

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/jit/codegenlinear.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,22 @@ void CodeGen::genCodeForBBlist()
602602
{
603603
instGen(INS_BREAKPOINT); // This should never get executed
604604
}
605+
// Do likewise for blocks that end in DOES_NOT_RETURN calls
606+
// that were not caught by the above rules. This ensures that
607+
// gc register liveness doesn't change across call instructions
608+
// in fully-interruptible mode.
609+
else
610+
{
611+
GenTree* call = block->lastNode();
612+
613+
if ((call != nullptr) && (call->gtOper == GT_CALL))
614+
{
615+
if ((call->gtCall.gtCallMoreFlags & GTF_CALL_M_DOES_NOT_RETURN) != 0)
616+
{
617+
instGen(INS_BREAKPOINT); // This should never get executed
618+
}
619+
}
620+
}
605621

606622
break;
607623

0 commit comments

Comments
 (0)