public:
UnwindEpilogCodes(Compiler* comp)
- : UnwindBase(comp), uecMem(uecMemLocal), uecMemSize(UEC_LOCAL_COUNT), uecCodeSlot(-1), uecFinalized(false)
+ : UnwindBase(comp)
+ , uecMem(uecMemLocal)
+ , firstByteOfLastCode(0)
+ , uecMemSize(UEC_LOCAL_COUNT)
+ , uecCodeSlot(-1)
+ , uecFinalized(false)
{
}
virtual void AddCode(BYTE b1)
{
AppendByte(b1);
+
+ firstByteOfLastCode = b1;
}
virtual void AddCode(BYTE b1, BYTE b2)
{
AppendByte(b1);
AppendByte(b2);
+
+ firstByteOfLastCode = b1;
}
virtual void AddCode(BYTE b1, BYTE b2, BYTE b3)
AppendByte(b1);
AppendByte(b2);
AppendByte(b3);
+
+ firstByteOfLastCode = b1;
}
virtual void AddCode(BYTE b1, BYTE b2, BYTE b3, BYTE b4)
AppendByte(b2);
AppendByte(b3);
AppendByte(b4);
+
+ firstByteOfLastCode = b1;
}
// Return a pointer to the first unwind code byte
{
assert(!uecFinalized);
noway_assert(0 <= uecCodeSlot && uecCodeSlot < uecMemSize); // There better be at least one code!
- BYTE lastCode = uecMem[uecCodeSlot];
- if (!IsEndCode(lastCode)) // If the last code is an end code, we don't need to append one.
+
+ if (!IsEndCode(firstByteOfLastCode)) // If the last code is an end code, we don't need to append one.
{
- AppendByte(UWC_END); // Add a default "end" code to the end of the array of unwind codes
+ AppendByte(UWC_END); // Add a default "end" code to the end of the array of unwind codes
+ firstByteOfLastCode = UWC_END; // Update firstByteOfLastCode in case we use it later
}
+
uecFinalized = true; // With the "end" code in place, now we're done
#ifdef DEBUG
// If there are more unwind codes, we dynamically allocate memory.
BYTE uecMemLocal[UEC_LOCAL_COUNT];
BYTE* uecMem;
+ BYTE firstByteOfLastCode;
// uecMemSize is the number of bytes/slots in uecMem. This is equal to UEC_LOCAL_COUNT unless
// we've dynamically allocated memory to store the codes.
WorkingDir=Loader\classloader\TypeGeneratorTests\TypeGeneratorTest963\Generated963
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9457;NEW
+Categories=EXPECTED_PASS;NEW
HostStyle=0
[Generated407.cmd_10034]
WorkingDir=Loader\classloader\TypeGeneratorTests\TypeGeneratorTest928\Generated928
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9457;NEW
+Categories=EXPECTED_PASS;NEW
HostStyle=0
[DevDiv_367099.cmd_10823]
WorkingDir=Loader\classloader\TypeGeneratorTests\TypeGeneratorTest763\Generated763
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9457;NEW
+Categories=EXPECTED_PASS;NEW
HostStyle=0
[Generated1349.cmd_10914]
WorkingDir=Loader\classloader\TypeGeneratorTests\TypeGeneratorTest693\Generated693
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9457;NEW
+Categories=EXPECTED_PASS;NEW
HostStyle=0
[Generated500.cmd_11036]
WorkingDir=Loader\classloader\TypeGeneratorTests\TypeGeneratorTest688\Generated688
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9457;NEW
+Categories=EXPECTED_PASS;NEW
HostStyle=0
[Generated169.cmd_11172]
WorkingDir=Loader\classloader\TypeGeneratorTests\TypeGeneratorTest1411\Generated1411
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9457;NEW
+Categories=EXPECTED_PASS;NEW
HostStyle=0
[Generated303.cmd_11319]
WorkingDir=Loader\classloader\TypeGeneratorTests\TypeGeneratorTest1412\Generated1412
Expected=0
MaxAllowedDurationSeconds=600
-Categories=EXPECTED_FAIL;9457;NEW
+Categories=EXPECTED_PASS;NEW
HostStyle=0
[Generated1272.cmd_11380]