Skip to content

Commit

Permalink
XS: Compartment tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Soquet committed Jan 3, 2022
1 parent 8937d55 commit 5b6f857
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion xs/sources/xsModule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1858,7 +1858,7 @@ void fx_Compartment(txMachine* the)

// MODULE MAP

if (mxArgc > 1) {
if ((mxArgc > 1) && (mxIsReference(mxArgv(1)))) {
txSlot* target;
txSlot* source;
txSlot* at;
Expand Down
14 changes: 7 additions & 7 deletions xs/tools/xst.c
Original file line number Diff line number Diff line change
Expand Up @@ -1567,7 +1567,6 @@ txID fxFindModule(txMachine* the, txSlot* realm, txID moduleID, txSlot* slot)
{
char name[C_PATH_MAX];
char path[C_PATH_MAX];
char real[C_PATH_MAX];
txInteger dot = 0;
txString slash;
fxToStringBuffer(the, slot, name, sizeof(name));
Expand Down Expand Up @@ -1608,24 +1607,25 @@ txID fxFindModule(txMachine* the, txSlot* realm, txID moduleID, txSlot* slot)
slash = path;
*slash = 0;
c_strcat(path, name + dot);
if (c_realpath(path, real))
return fxNewNameC(the, real);
return XS_NO_ID;
return fxNewNameC(the, path);
}

void fxLoadModule(txMachine* the, txSlot* module, txID moduleID)
{
char path[C_PATH_MAX];
char real[C_PATH_MAX];
txScript* script;
#ifdef mxDebug
txUnsigned flags = mxDebugFlag;
#else
txUnsigned flags = 0;
#endif
c_strcpy(path, fxGetKeyName(the, moduleID));
script = fxLoadScript(the, path, flags);
if (script)
fxResolveModule(the, module, moduleID, script, C_NULL, C_NULL);
if (c_realpath(path, real)) {
script = fxLoadScript(the, real, flags);
if (script)
fxResolveModule(the, module, moduleID, script, C_NULL, C_NULL);
}
}

txScript* fxLoadScript(txMachine* the, txString path, txUnsigned flags)
Expand Down

0 comments on commit 5b6f857

Please sign in to comment.