[Python-checkins] python/dist/src/Python newcompile.c, 1.1.2.69, 1.1.2.70

nnorwitz at users.sourceforge.net nnorwitz at users.sourceforge.net
Mon Feb 9 17:23:27 EST 2004


Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1455/Python

Modified Files:
      Tag: ast-branch
	newcompile.c 
Log Message:
get augassign working

Index: newcompile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v
retrieving revision 1.1.2.69
retrieving revision 1.1.2.70
diff -C2 -d -r1.1.2.69 -r1.1.2.70
*** newcompile.c	27 Jan 2004 23:21:38 -0000	1.1.2.69
--- newcompile.c	9 Feb 2004 22:23:25 -0000	1.1.2.70
***************
*** 25,30 ****
     Inappropriate Exceptions:
       #: problem with cell objects (closures still have bugs)
-      #: x = [1] ; x[0] += 1 
-         raises TypeError: object does not support item assignment
       #: Get this err msg: XXX rd_object called with exception set
          From Python/marshal.c::PyMarshal_ReadLastObjectFromFile()
--- 25,28 ----
***************
*** 2081,2084 ****
--- 2079,2084 ----
  		auge = Attribute(e->v.Attribute.value, e->v.Attribute.attr,
  				 AugLoad);
+                 if (auge == NULL)
+                     return 0;
  		VISIT(c, expr, auge);
  		VISIT(c, expr, s->v.AugAssign.value);
***************
*** 2091,2098 ****
  		auge = Subscript(e->v.Subscript.value, e->v.Subscript.slice,
  				 AugLoad);
  		VISIT(c, expr, auge);
  		VISIT(c, expr, s->v.AugAssign.value);
  		ADDOP(c, inplace_binop(c, s->v.AugAssign.op));
! 		auge->v.Subscript.ctx = AugStore;
  		VISIT(c, expr, auge);
  		free(auge);
--- 2091,2100 ----
  		auge = Subscript(e->v.Subscript.value, e->v.Subscript.slice,
  				 AugLoad);
+                 if (auge == NULL)
+                     return 0;
  		VISIT(c, expr, auge);
  		VISIT(c, expr, s->v.AugAssign.value);
  		ADDOP(c, inplace_binop(c, s->v.AugAssign.op));
!                 auge->v.Subscript.ctx = AugStore;
  		VISIT(c, expr, auge);
  		free(auge);
***************
*** 2232,2235 ****
--- 2234,2238 ----
  		case 0: ADDOP(c, DUP_TOP); break;
  		case 1: ADDOP_I(c, DUP_TOPX, 2); break;
+ 		case 2: ADDOP_I(c, DUP_TOPX, 3); break;
  		}
  	}
***************
*** 2238,2241 ****
--- 2241,2245 ----
  		case 0: ADDOP(c, ROT_TWO); break;
  		case 1: ADDOP(c, ROT_THREE); break;
+ 		case 2: ADDOP(c, ROT_FOUR); break;
  		}
  	}
***************
*** 2270,2274 ****
  		break;
  	case Index_kind:
! 		VISIT(c, expr, s->v.Index.value);
                  return compiler_handle_subscr(c, "index", ctx);
  	}
--- 2274,2279 ----
  		break;
  	case Index_kind:
!                 if (ctx != AugStore)
! 			VISIT(c, expr, s->v.Index.value);
                  return compiler_handle_subscr(c, "index", ctx);
  	}




More information about the Python-checkins mailing list