summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-06-28 16:17:34 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-06-28 16:17:34 (GMT)
commit6d46a91dc08af57b395b55d10f93e8d5c54372cd (patch)
tree40727d464f4580cffafafba9d7e3a7736c94720e /Python
parentac8c73075af1768da0ff3ddb2a3a85ea135ca3b2 (diff)
downloadcpython-6d46a91dc08af57b395b55d10f93e8d5c54372cd.zip
cpython-6d46a91dc08af57b395b55d10f93e8d5c54372cd.tar.gz
cpython-6d46a91dc08af57b395b55d10f93e8d5c54372cd.tar.bz2
Merged revisions 73614-73615 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r73614 | benjamin.peterson | 2009-06-28 11:08:02 -0500 (Sun, 28 Jun 2009) | 1 line add two generic macros for peeking and setting in the stack ........ r73615 | benjamin.peterson | 2009-06-28 11:14:07 -0500 (Sun, 28 Jun 2009) | 1 line use stack macros ........
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 3ca972a..a5d465c 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -919,10 +919,12 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
#define SECOND() (stack_pointer[-2])
#define THIRD() (stack_pointer[-3])
#define FOURTH() (stack_pointer[-4])
+#define PEEK(n) (stack_pointer[-(n)])
#define SET_TOP(v) (stack_pointer[-1] = (v))
#define SET_SECOND(v) (stack_pointer[-2] = (v))
#define SET_THIRD(v) (stack_pointer[-3] = (v))
#define SET_FOURTH(v) (stack_pointer[-4] = (v))
+#define SET_VALUE(n, v) (stack_pointer[-(n)] = (v))
#define BASIC_STACKADJ(n) (stack_pointer += n)
#define BASIC_PUSH(v) (*stack_pointer++ = (v))
#define BASIC_POP() (*--stack_pointer)
@@ -1548,7 +1550,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
TARGET(LIST_APPEND)
w = POP();
- v = stack_pointer[-oparg];
+ v = PEEK(oparg);
err = PyList_Append(v, w);
Py_DECREF(w);
if (err == 0) {
@@ -1909,7 +1911,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
}
} else if (unpack_iterable(v, oparg, -1,
stack_pointer + oparg)) {
- stack_pointer += oparg;
+ STACKADJ(oparg);
} else {
/* unpack_iterable() raised an exception */
why = WHY_EXCEPTION;