summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1993-05-20 14:24:46 (GMT)
committerGuido van Rossum <guido@python.org>1993-05-20 14:24:46 (GMT)
commit81daa32c15cfa9f05eda037916cdbfd5b4323431 (patch)
tree82d67f6db4ff6f1ae1a682f2ec4b01d075f3e405 /Python/compile.c
parent25831652fd4c03323066d4cafdc0551c396a993e (diff)
downloadcpython-81daa32c15cfa9f05eda037916cdbfd5b4323431.zip
cpython-81daa32c15cfa9f05eda037916cdbfd5b4323431.tar.gz
cpython-81daa32c15cfa9f05eda037916cdbfd5b4323431.tar.bz2
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.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/compile.c b/Python/compile.c
index d9d661c..a8cd4e9 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1429,8 +1429,8 @@ com_access_stmt(c, n)
/* Calculate the mode mask */
mode = 0;
for (j = i; j < NCH(n); j += 2) {
- int r=0,w=0,p=0;
- for (k=0; k<NCH(CHILD(n,j)); k++) {
+ int r = 0, w = 0, p = 0;
+ for (k = 0; k < NCH(CHILD(n,j)); k++) {
if (strequ(STR(CHILD(CHILD(n,j),k)), "public"))
p = 0;
else if (strequ(STR(CHILD(CHILD(n,j),k)), "protected"))
@@ -1446,7 +1446,7 @@ com_access_stmt(c, n)
STR(CHILD(CHILD(n,j),k)));
}
if (r == 0 && w == 0)
- r =w = 1;
+ r = w = 1;
if (p == 0) {
if (r == 1) mode |= AC_R_PUBLIC;
if (w == 1) mode |= AC_W_PUBLIC;