Skip to content

Commit

Permalink
XS: secaudit issue #12
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Soquet committed Nov 24, 2021
1 parent abd72cf commit 691c895
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions xs/sources/xsModule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1730,9 +1730,11 @@ txBoolean fxModuleSetPrototype(txMachine* the, txSlot* instance, txSlot* prototy

txSlot* fxCheckCompartmentInstance(txMachine* the, txSlot* slot)
{
txSlot* instance = slot->value.reference;
if (((slot = instance->next)) && (slot->flag & XS_INTERNAL_FLAG) && (slot->kind == XS_PROGRAM_KIND)) {
return instance;
if (slot->kind == XS_REFERENCE_KIND) {
txSlot* instance = slot->value.reference;
if (((slot = instance->next)) && (slot->flag & XS_INTERNAL_FLAG) && (slot->kind == XS_PROGRAM_KIND)) {
return instance;
}
}
mxTypeError("this is no Compartment instance");
return C_NULL;
Expand Down

0 comments on commit 691c895

Please sign in to comment.