// Note that we can't use small values like zero, because we have some
// asserts that can fire for such values.
//
-unsigned char Compiler::compGetJitDefaultFill()
+// static
+unsigned char Compiler::compGetJitDefaultFill(Compiler* comp)
{
unsigned char defaultFill = (unsigned char)JitConfig.JitDefaultFill();
- if ((this != nullptr) && (compStressCompile(STRESS_GENERIC_VARN, 50)))
+ if (comp != nullptr && comp->compStressCompile(STRESS_GENERIC_VARN, 50))
{
unsigned temp;
- temp = info.compMethodHash();
+ temp = comp->info.compMethodHash();
temp = (temp >> 16) ^ temp;
temp = (temp >> 8) ^ temp;
temp = temp & 0xff;
{
temp |= 0x80;
}
+
+ // Make a misaligned pointer value to reduce probability of getting a valid value and firing
+ // assert(!IsUninitialized(pointer)).
+ temp |= 0x1;
+
defaultFill = (unsigned char)temp;
}
bool compDonotInline();
#ifdef DEBUG
- unsigned char compGetJitDefaultFill(); // Get the default fill char value
- // we randomize this value when JitStress is enabled
+ // Get the default fill char value we randomize this value when JitStress is enabled.
+ static unsigned char compGetJitDefaultFill(Compiler* comp);
const char* compLocalVarName(unsigned varNum, unsigned offs);
VarName compVarName(regNumber reg, bool isFloatReg = false);
{
comp = JitTls::GetCompiler();
}
- defaultFill = comp->compGetJitDefaultFill();
+ defaultFill = Compiler::compGetJitDefaultFill(comp);
assert(defaultFill <= 0xff);
__int64 word = 0x0101010101010101LL * defaultFill;
return (T)word;