mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-14 14:24:10 +02:00
Fixed alloca+memset check
This commit is contained in:
parent
22b234f930
commit
19c34255df
1 changed files with 12 additions and 0 deletions
|
@ -15453,6 +15453,18 @@ void BeMCContext::Generate(BeFunction* function)
|
||||||
// If we're clearing out this memory immediately after allocation then we don't
|
// 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
|
// need to do stack probing - the memset will ensure stack pages are committed
|
||||||
needsChkStk = false;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue