diff options
author | Jan Vorlicek <janvorli@microsoft.com> | 2016-06-07 07:52:50 +0200 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2016-06-06 22:52:50 -0700 |
commit | f5d09cd7d82549b258f224c36a095d62e06e1228 (patch) | |
tree | d217d27812067502cb15ca5ef270efa371763b60 /src | |
parent | d719bfbc83eee5ec0a974f83b82f3f92541a5ba5 (diff) | |
download | coreclr-f5d09cd7d82549b258f224c36a095d62e06e1228.tar.gz coreclr-f5d09cd7d82549b258f224c36a095d62e06e1228.tar.bz2 coreclr-f5d09cd7d82549b258f224c36a095d62e06e1228.zip |
Fix GC references reporting in tailcalls with helpers on Windows (#5538)
This change fixes a problem with reporting a range of exactly 3 continuous
GC references in tailcall with helper. The code was asserting in that case
in debug build and generating incorrect offsets in release build.
The problem was that the offset generation and assert was off by 1. It was
supposed to generate offset of the last reference in the range, but instead
generated offset after the last reference.
Diffstat (limited to 'src')
-rw-r--r-- | src/vm/i386/stublinkerx86.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/vm/i386/stublinkerx86.cpp b/src/vm/i386/stublinkerx86.cpp index 2d9e01f69f..0037a7d3e6 100644 --- a/src/vm/i386/stublinkerx86.cpp +++ b/src/vm/i386/stublinkerx86.cpp @@ -5919,8 +5919,8 @@ void TailCallFrame::GcScanRoots(promote_func *fn, ScanContext* sc) atEnd = (offsetEnd & 1); offsetEnd = (offsetEnd & ~1) << 1; // range encoding starts with a range of 3 (2 is better to encode as - // 2 offsets), so 0 == 3 - offsetEnd += sizeof(void*) * 3; + // 2 offsets), so 0 == 2 (the last offset in the range) + offsetEnd += sizeof(void*) * 2; rangeEnd = prevOffset - offsetEnd; } @@ -6048,8 +6048,8 @@ static void EncodeGCOffsets(CPUSTUBLINKER *pSl, /* const */ ULONGARRAY & gcOffse { EncodeOneGCOffset(pSl, delta, FALSE, TRUE, last); i = j - 1; - _ASSERTE(rangeOffset >= (offset + (sizeof(void*) * 3))); - delta = rangeOffset - (offset + (sizeof(void*) * 3)); + _ASSERTE(rangeOffset >= (offset + (sizeof(void*) * 2))); + delta = rangeOffset - (offset + (sizeof(void*) * 2)); offset = rangeOffset; } } |