diff options
author | Eugene Rozenfeld <erozen@microsoft.com> | 2018-04-13 16:29:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-13 16:29:12 -0700 |
commit | ee5ab84c4c0c073f8ab463aed7ce9d10f5e26887 (patch) | |
tree | 32f1ad0c43171614259f44ec0931ade6925b52cd /src | |
parent | 3db838482038472ee9d75e3a204a77542d30b82b (diff) | |
download | coreclr-ee5ab84c4c0c073f8ab463aed7ce9d10f5e26887.tar.gz coreclr-ee5ab84c4c0c073f8ab463aed7ce9d10f5e26887.tar.bz2 coreclr-ee5ab84c4c0c073f8ab463aed7ce9d10f5e26887.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/jit/codegenlinear.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/jit/codegenlinear.cpp b/src/jit/codegenlinear.cpp index 6faaf612be..26b52c20d2 100644 --- a/src/jit/codegenlinear.cpp +++ b/src/jit/codegenlinear.cpp @@ -602,6 +602,22 @@ void CodeGen::genCodeForBBlist() { instGen(INS_BREAKPOINT); // This should never get executed } + // Do likewise for blocks that end in DOES_NOT_RETURN calls + // that were not caught by the above rules. This ensures that + // gc register liveness doesn't change across call instructions + // in fully-interruptible mode. + else + { + GenTree* call = block->lastNode(); + + if ((call != nullptr) && (call->gtOper == GT_CALL)) + { + if ((call->gtCall.gtCallMoreFlags & GTF_CALL_M_DOES_NOT_RETURN) != 0) + { + instGen(INS_BREAKPOINT); // This should never get executed + } + } + } break; |