Skip to content

Commit

Permalink
fix: incorrect behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
jacopodl committed Jan 24, 2024
1 parent b1ad5b4 commit c46bf8b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 6 additions & 5 deletions argon/vm/datatype/arobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,12 @@ ArObject *argon::vm::datatype::Compare(const ArObject *self, const ArObject *oth
result = rc(other, self, reverse[(int) mode]);

if (result == nullptr) {
if (mode != CompareMode::EQ) {
ErrorFormat(kNotImplementedError[0], kNotImplementedError[2], str_mode[(int) mode],
AR_TYPE_NAME(self), AR_TYPE_NAME(other));
if (mode != CompareMode::EQ && !IsPanickingFrame()) {
ErrorFormat(kNotImplementedError[0],
kNotImplementedError[2],
str_mode[(int) mode],
AR_TYPE_NAME(self),
AR_TYPE_NAME(other));
return nullptr;
}

Expand Down Expand Up @@ -858,8 +861,6 @@ bool ExportDefaultMethod(TypeInfo *type) {

FunctionDef fdef{};

ArObject *tmp;

bool exists;

fdef.method = true;
Expand Down
5 changes: 4 additions & 1 deletion argon/vm/panic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ void argon::vm::PanicFill(Panic *panic, Panic *prev, Frame *frame, ArObject *obj
panic->frame = frame;
panic->object = IncRef(object);
panic->recovered = false;
panic->aborted = prev != nullptr;
panic->aborted = false;

if (prev != nullptr)
prev->aborted = true;

if (panic->frame != nullptr)
panic->frame->counter++;
Expand Down

0 comments on commit c46bf8b

Please sign in to comment.