1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

String.ToConstNativeW

This commit is contained in:
Brian Fiete 2022-02-13 06:53:14 -05:00
parent 6c714bacdc
commit b341b6d3b4
3 changed files with 16 additions and 2 deletions

View file

@ -4195,8 +4195,9 @@ BfTypedValue CeContext::Call(BfAstNode* targetSrc, BfModule* module, BfMethodIns
SetAndRestoreValue<BfTypeDef*> prevCallerActiveTypeDef(mCallerActiveTypeDef, module->GetActiveTypeDef());
SetAndRestoreValue<BfType*> prevExpectingType(mCurExpectingType, expectingType);
SetAndRestoreValue<bool> prevCtxResolvingVar(module->mContext->mResolvingVarField, false);
SetAndRestoreValue<BfMethodInstance*> moduleCurMethodInstance(module->mCurMethodInstance, methodInstance);
SetAndRestoreValue<BfTypeInstance*> moduleCurTypeInstance(module->mCurTypeInstance, methodInstance->GetOwner());
SetAndRestoreValue<BfTypeInstance*> moduleCurTypeInstance(module->mCurTypeInstance, methodInstance->GetOwner());
SetAndRestoreValue<int> prevCurExecuteId(mCurModule->mCompiler->mCurCEExecuteId, mCeMachine->mExecuteId);
@ -4561,7 +4562,7 @@ BfTypedValue CeContext::Call(BfAstNode* targetSrc, BfModule* module, BfMethodIns
else if ((retInstAddr != 0) || (allocThisInstAddr != 0))
{
auto* retPtr = memStart + retInstAddr;
if (allocThisInstAddr != 0)
if ((allocThisInstAddr != 0) && (methodInstance->mMethodDef->mMethodType == BfMethodType_Ctor))
{
retPtr = memStart + allocThisAddr;
returnType = thisType;