1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Fixed comptime const evals within comptime

This commit is contained in:
Brian Fiete 2022-02-02 07:27:03 -05:00
parent 1ee32434a5
commit 6c3944170d
5 changed files with 47 additions and 13 deletions

View file

@ -5078,11 +5078,19 @@ bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8*
SetAndRestoreValue<BfMethodInstance*> prevMethodInstance(mCurModule->mCurMethodInstance, mCallerMethodInstance);
SetAndRestoreValue<BfTypeInstance*> prevTypeInstance(mCurModule->mCurTypeInstance, mCallerTypeInstance);
int32 strInstAddr = *(int32*)((uint8*)stackPtr + 0);
// int32 strInstAddr = *(int32*)((uint8*)stackPtr + 0);
// String emitStr;
// if (!GetStringFromAddr(strInstAddr, emitStr))
// {
// _Fail("Invalid String");
// return false;
// }
addr_ce strViewPtr = *(addr_ce*)((uint8*)stackPtr);
String emitStr;
if (!GetStringFromAddr(strInstAddr, emitStr))
if (!GetStringFromStringView(strViewPtr, emitStr))
{
_Fail("Invalid String");
_Fail("Invalid StringView");
return false;
}