A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/attachments/20040604/cf70e9a5/compile.c.bin below:

*** Python-2.3.3-orig/Python/compile.c Mon Sep 22 07:41:21 2003 --- Python-2.3.3/Python/compile.c Thu Jun 3 00:11:40 2004 *************** *** 1892,1897 **** --- 1892,1900 ---- { int i=0; int ns=2; /* number of slice arguments */ + int islength=0; + int length_anchor1=0; + int length_anchor2=0; node *ch; /* first argument */ *************** *** 1903,1909 **** else { com_node(c, CHILD(n,i)); i++; ! REQ(CHILD(n,i),COLON); i++; } /* second argument */ --- 1906,1926 ---- else { com_node(c, CHILD(n,i)); i++; ! if (TYPE(CHILD(n,i)) == COLONGREATER) { ! islength = 1; ! com_addbyte(c, DUP_TOP); ! /* All this code performs this: ! If the calculated end < 0 and start >= 0, ! put -sys.maxint instead of the calculated length. */ ! com_addbyte(c, DUP_TOP); ! com_addoparg(c, LOAD_CONST, com_addconst(c, PyInt_FromLong(0))); ! com_addoparg(c, COMPARE_OP, PyCmp_GE); ! com_addbyte(c, ROT_TWO); ! /* Now in stack: start, start >= 0, start */ ! } ! else { ! REQ(CHILD(n,i),COLON); ! } i++; } /* second argument */ *************** *** 1915,1920 **** --- 1932,1961 ---- com_addoparg(c, LOAD_CONST, com_addconst(c, Py_None)); com_push(c, 1); } + if (islength) { + /* Swap start, length with start+length*/ + com_addbyte(c, BINARY_ADD); + com_addbyte(c, ROT_TWO); + /* Now in stack: start, end, start >= 0 + If start < 0, jump to anchor1. */ + com_addfwref(c, JUMP_IF_FALSE, &length_anchor1); + com_addbyte(c, POP_TOP); + com_addbyte(c, DUP_TOP); + com_addoparg(c, LOAD_CONST, com_addconst(c, PyInt_FromLong(0))); + com_addoparg(c, COMPARE_OP, PyCmp_LT); + /* Now in stack: start, end, end < 0 + If end >= 0, jump to anchor1. */ + com_addfwref(c, JUMP_IF_FALSE, &length_anchor1); + com_addbyte(c, POP_TOP); + /* Replace end with -sys.maxint */ + com_addbyte(c, POP_TOP); + com_addoparg(c, LOAD_CONST, com_addconst(c, PyInt_FromLong(-PyInt_GetMax()))); + /* Pop comparison result, if needed. */ + com_addfwref(c, JUMP_FORWARD, &length_anchor2); + com_backpatch(c, length_anchor1); + com_addbyte(c, POP_TOP); + com_backpatch(c, length_anchor2); + } /* remaining arguments */ for (; i < NCH(n); i++) { ns++;

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4