mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Added string literal to fixup queue
This commit is contained in:
parent
8047bebfca
commit
a5e0a5688b
1 changed files with 14 additions and 1 deletions
|
@ -6423,8 +6423,21 @@ CeErrorKind CeMachine::WriteConstant(CeConstStructData& data, BeConstant* constV
|
||||||
if (globalVar->mName.StartsWith("__bfStrObj"))
|
if (globalVar->mName.StartsWith("__bfStrObj"))
|
||||||
{
|
{
|
||||||
int stringId = atoi(globalVar->mName.c_str() + 10);
|
int stringId = atoi(globalVar->mName.c_str() + 10);
|
||||||
addr_ce stringAddr = ceContext->GetString(stringId);
|
|
||||||
|
|
||||||
|
addr_ce stringAddr;
|
||||||
|
if (data.mQueueFixups)
|
||||||
|
{
|
||||||
|
stringAddr = 0;
|
||||||
|
CeConstStructFixup fixup;
|
||||||
|
fixup.mKind = CeConstStructFixup::Kind_StringPtr;
|
||||||
|
fixup.mValue = stringId;
|
||||||
|
fixup.mOffset = (int)data.mData.mSize;
|
||||||
|
data.mFixups.Add(fixup);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
stringAddr = ceContext->GetString(stringId);
|
||||||
|
}
|
||||||
auto ptr = data.mData.GrowUninitialized(ceModule->mSystem->mPtrSize);
|
auto ptr = data.mData.GrowUninitialized(ceModule->mSystem->mPtrSize);
|
||||||
int64 addr64 = stringAddr;
|
int64 addr64 = stringAddr;
|
||||||
memcpy(ptr, &addr64, ceModule->mSystem->mPtrSize);
|
memcpy(ptr, &addr64, ceModule->mSystem->mPtrSize);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue