Skip to content

Commit

Permalink
fix: corrected an issue that prevented access to an object's private …
Browse files Browse the repository at this point in the history
…properties via static method invocation
  • Loading branch information
jacopodl committed Jun 17, 2024
1 parent 38be073 commit b7ab012
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions argon/vm/datatype/arobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ ArObject *type_get_attr(const ArObject *instance, ArObject *key, bool static_att
return nullptr;
}

if (static_attr && AR_TYPEOF(instance, type_type_))
ancestor = (TypeInfo *) instance;

if (!aprop.IsPublic() && !TraitIsImplemented(ancestor, base)) {
ErrorFormat(kAccessViolationError[0], kAccessViolationError[1],
ARGON_RAW_STRING((String *) key), ancestor->name);
Expand Down

0 comments on commit b7ab012

Please sign in to comment.