Skip to content

Commit

Permalink
Fix introspect.get() (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-hadinger committed Jul 15, 2023
1 parent 45b11a9 commit e66eab1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/be_introspectlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,15 @@ static int m_findmember(bvm *vm)
if (top >= 3) {
protected = !be_tobool(vm, 3);
}
if (top >= 2) {
if (protected && (be_isinstance(vm, 1) || be_ismodule(vm, 1) || be_isclass(vm, 1)) && be_isstring(vm, 2)) {
int ret = be_execprotected(vm, &m_findmember_protected, (void*) be_tostring(vm, 2));
if (ret == BE_OK) {
be_return(vm);
if (top >= 2 && be_isstring(vm, 2)) {
if (protected) {
if (be_isinstance(vm, 1) || be_ismodule(vm, 1) || be_isclass(vm, 1)) {
int ret = be_execprotected(vm, &m_findmember_protected, (void*) be_tostring(vm, 2));
if (ret == BE_OK) {
be_return(vm);
}
}
be_return_nil(vm);
} else {
/* run unprotected */
if (be_getmember(vm, 1, be_tostring(vm, 2))) {
Expand Down

0 comments on commit e66eab1

Please sign in to comment.