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

Improved "const" handling of local variable when referencing globals

This commit is contained in:
Brian Fiete 2025-05-22 06:03:18 +02:00
parent 989e8455e8
commit e7a966c1b5
3 changed files with 7 additions and 27 deletions

View file

@ -666,6 +666,10 @@ bool BfIRConstHolder::IsConstValue(BfIRValue value)
return false;
if (constant->mConstType == BfConstType_Undef)
return false;
if (constant->mConstType == BfConstType_GEP32_2)
return IsConstValue(BfIRValue(BfIRValueFlags_Const, ((BfConstantGEP32_2*)constant)->mTarget));
if (constant->mConstType == BfConstType_BitCast)
return IsConstValue(BfIRValue(BfIRValueFlags_Const, ((BfConstantBitCast*)constant)->mTarget));
return true;
}