Fix string return value

This commit is contained in:
Magnus Norddahl 2020-06-12 01:21:29 +02:00
parent 96d1e2be50
commit 1e82cf877d
2 changed files with 2 additions and 2 deletions

View file

@ -27,7 +27,7 @@ JitFuncPtr JitCompile(VMScriptFunction* sfunc)
JitCompiler compiler(&context, sfunc);
IRFunction* func = compiler.Codegen();
jit->add(&context);
std::string text = context.getFunctionAssembly(func);
//std::string text = context.getFunctionAssembly(func);
return reinterpret_cast<JitFuncPtr>(jit->getPointerToFunction(func->name));
}
catch (...)

View file

@ -129,7 +129,7 @@ void JitCompiler::EmitRET()
break;
case REGT_STRING:
{
cc.CreateCall(setReturnString, { location, (regtype & REGT_KONST) ? ConstS(regnum) : LoadS(regnum) });
cc.CreateCall(setReturnString, { OffsetPtr(ret, retnum * sizeof(VMReturn)), (regtype & REGT_KONST) ? ConstS(regnum) : LoadS(regnum) });
break;
}
case REGT_POINTER: