1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42:21 +02:00

Fixed alloca+memset check

This commit is contained in:
Brian Fiete 2019-11-27 08:00:56 -08:00
parent 22b234f930
commit 19c34255df

View file

@ -15453,6 +15453,18 @@ void BeMCContext::Generate(BeFunction* function)
// If we're clearing out this memory immediately after allocation then we don't
// need to do stack probing - the memset will ensure stack pages are committed
needsChkStk = false;
if (mcSize.IsImmediate())
{
if (auto sizeConst = BeValueDynCast<BeConstant>(memSetInstr->mSize))
{
if (sizeConst->mInt64 < mcSize.mImmediate)
{
// We haven't actually cleared out everything so we still need to chkStk
needsChkStk = true;
}
}
}
}
}
}