mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
BfpSpawn_Create fixes
This commit is contained in:
parent
2f72311f1f
commit
1d621f5d31
1 changed files with 21 additions and 12 deletions
|
@ -5266,26 +5266,35 @@ bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8*
|
||||||
addr_ce workingDirAddr = *(addr_ce*)((uint8*)stackPtr + ptrSize + ptrSize + ptrSize);
|
addr_ce workingDirAddr = *(addr_ce*)((uint8*)stackPtr + ptrSize + ptrSize + ptrSize);
|
||||||
addr_ce envAddr = *(addr_ce*)((uint8*)stackPtr + ptrSize + ptrSize + ptrSize + ptrSize);
|
addr_ce envAddr = *(addr_ce*)((uint8*)stackPtr + ptrSize + ptrSize + ptrSize + ptrSize);
|
||||||
int flags = *(int*)((uint8*)stackPtr + ptrSize + ptrSize + ptrSize + ptrSize + ptrSize);
|
int flags = *(int*)((uint8*)stackPtr + ptrSize + ptrSize + ptrSize + ptrSize + ptrSize);
|
||||||
addr_ce outResultAddr = *(addr_ce*)((uint8*)stackPtr + ptrSize + ptrSize + ptrSize + ptrSize + ptrSize + ptrSize);
|
addr_ce outResultAddr = *(addr_ce*)((uint8*)stackPtr + ptrSize + ptrSize + ptrSize + ptrSize + ptrSize + 4);
|
||||||
|
|
||||||
String targetPath;
|
String targetPath;
|
||||||
CE_CHECKADDR_STR(targetPath, targetPathAddr);
|
CE_CHECKADDR_STR(targetPath, targetPathAddr);
|
||||||
String args;
|
String args;
|
||||||
|
if (argsAddr != 0)
|
||||||
CE_CHECKADDR_STR(args, argsAddr);
|
CE_CHECKADDR_STR(args, argsAddr);
|
||||||
String workingDir;
|
String workingDir;
|
||||||
|
if (workingDirAddr != 0)
|
||||||
CE_CHECKADDR_STR(workingDir, workingDirAddr);
|
CE_CHECKADDR_STR(workingDir, workingDirAddr);
|
||||||
String env;
|
String env;
|
||||||
|
if (envAddr != 0)
|
||||||
CE_CHECKADDR_STR(env, envAddr);
|
CE_CHECKADDR_STR(env, envAddr);
|
||||||
CE_CHECKADDR(outResultAddr, 4);
|
CE_CHECKADDR(outResultAddr, 4);
|
||||||
|
|
||||||
|
if ((targetPath.Contains('/')) || (targetPath.Contains('\\')))
|
||||||
|
{
|
||||||
BfProject* activeProject = NULL;
|
BfProject* activeProject = NULL;
|
||||||
auto activeTypeDef = mCurModule->GetActiveTypeDef();
|
auto activeTypeDef = mCurModule->GetActiveTypeDef();
|
||||||
if (activeTypeDef != NULL)
|
if (activeTypeDef != NULL)
|
||||||
activeProject = activeTypeDef->mProject;
|
activeProject = activeTypeDef->mProject;
|
||||||
if (activeProject != NULL)
|
if (activeProject != NULL)
|
||||||
targetPath = GetAbsPath(targetPath, activeProject->mDirectory);
|
targetPath = GetAbsPath(targetPath, activeProject->mDirectory);
|
||||||
|
}
|
||||||
|
|
||||||
auto bfpSpawn = BfpSpawn_Create(targetPath.c_str(), args.c_str(), workingDir.c_str(), env.c_str(), (BfpSpawnFlags)flags, (BfpSpawnResult*)(memStart + outResultAddr));
|
auto bfpSpawn = BfpSpawn_Create(targetPath.c_str(),
|
||||||
|
(argsAddr == 0) ? NULL : args.c_str(),
|
||||||
|
(workingDirAddr == 0) ? NULL : workingDir.c_str(),
|
||||||
|
(envAddr == 0) ? NULL : env.c_str(), (BfpSpawnFlags)flags, (BfpSpawnResult*)(memStart + outResultAddr));
|
||||||
if (bfpSpawn != NULL)
|
if (bfpSpawn != NULL)
|
||||||
{
|
{
|
||||||
CeInternalData* internalData = new CeInternalData();
|
CeInternalData* internalData = new CeInternalData();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue