Access checks now work, at least for instance data (not for methods
yet). The class is now passed to eval_code and stored in the current
frame. It is also stored in instance method objects. An "unbound"
instance method is now returned when a function is retrieved through
"classname.funcname", which when called passes the class to eval_code.
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c
index 8949c7d..5c0db15 100644
--- a/Objects/moduleobject.c
+++ b/Objects/moduleobject.c
@@ -25,6 +25,7 @@
/* Module object implementation */
#include "allobjects.h"
+#include "ceval.h"
typedef struct {
OB_HEAD
@@ -111,7 +112,7 @@
err_setstr(AttributeError, name);
else {
if (is_accessobject(res))
- res = getaccessvalue(res, (object *)NULL);
+ res = getaccessvalue(res, getclass());
else
INCREF(res);
}
@@ -134,7 +135,7 @@
}
ac = dictlookup(m->md_dict, name);
if (ac != NULL && is_accessobject(ac))
- return setaccessvalue(ac, (object *)NULL, v);
+ return setaccessvalue(ac, getclass(), v);
if (v == NULL) {
int rv = dictremove(m->md_dict, name);
if (rv < 0)