diff options
author | Thomas Wouters <thomas@python.org> | 2000-10-05 12:43:25 (GMT) |
---|---|---|
committer | Thomas Wouters <thomas@python.org> | 2000-10-05 12:43:25 (GMT) |
commit | dc9100f57d5f20a4b9de644b7046de3c59197639 (patch) | |
tree | 1d7eef70165efcf69f7ff811a53cb52e3623f28a /Objects/abstract.c | |
parent | 7a90db613166e568a12621aa5448ce15eaf5c5d0 (diff) | |
download | cpython-dc9100f57d5f20a4b9de644b7046de3c59197639.zip cpython-dc9100f57d5f20a4b9de644b7046de3c59197639.tar.gz cpython-dc9100f57d5f20a4b9de644b7046de3c59197639.tar.bz2 |
Fix for SF bug #115987: PyInstance_HalfBinOp does not initialize the
result-object-pointer that is passed in, when an exception occurs during
coercion. The pointer has to be explicitly initialized in the caller to avoid
putting trash on the Python stack.
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r-- | Objects/abstract.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index b716f55..dfdfc43 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -651,7 +651,7 @@ PyObject * PyNumber_InPlaceOr(PyObject *v, PyObject *w) { PyObject * (*f)(PyObject *, PyObject *) = NULL; - PyObject *x; + PyObject *x = NULL; if (PyInstance_Check(v)) { if (PyInstance_HalfBinOp(v, w, "__ior__", &x, @@ -683,7 +683,7 @@ PyObject * PyNumber_InPlaceXor(PyObject *v, PyObject *w) { PyObject * (*f)(PyObject *, PyObject *) = NULL; - PyObject *x; + PyObject *x = NULL; if (PyInstance_Check(v)) { if (PyInstance_HalfBinOp(v, w, "__ixor__", &x, @@ -715,7 +715,7 @@ PyObject * PyNumber_InPlaceAnd(PyObject *v, PyObject *w) { PyObject * (*f)(PyObject *, PyObject *) = NULL; - PyObject *x; + PyObject *x = NULL; if (PyInstance_Check(v)) { if (PyInstance_HalfBinOp(v, w, "__iand__", &x, @@ -747,7 +747,7 @@ PyObject * PyNumber_InPlaceLshift(PyObject *v, PyObject *w) { PyObject * (*f)(PyObject *, PyObject *) = NULL; - PyObject *x; + PyObject *x = NULL; if (PyInstance_Check(v)) { if (PyInstance_HalfBinOp(v, w, "__ilshift__", &x, @@ -779,7 +779,7 @@ PyObject * PyNumber_InPlaceRshift(PyObject *v, PyObject *w) { PyObject * (*f)(PyObject *, PyObject *) = NULL; - PyObject *x; + PyObject *x = NULL; if (PyInstance_Check(v)) { if (PyInstance_HalfBinOp(v, w, "__irshift__", &x, @@ -811,7 +811,7 @@ PyObject * PyNumber_InPlaceAdd(PyObject *v, PyObject *w) { PyObject * (*f)(PyObject *, PyObject *) = NULL; - PyObject *x; + PyObject *x = NULL; if (PyInstance_Check(v)) { if (PyInstance_HalfBinOp(v, w, "__iadd__", &x, @@ -855,7 +855,7 @@ PyObject * PyNumber_InPlaceSubtract(PyObject *v, PyObject *w) { PyObject * (*f)(PyObject *, PyObject *) = NULL; - PyObject *x; + PyObject *x = NULL; if (PyInstance_Check(v)) { if (PyInstance_HalfBinOp(v, w, "__isub__", &x, @@ -888,7 +888,7 @@ PyNumber_InPlaceMultiply(PyObject *v, PyObject *w) { PyObject * (*f)(PyObject *, PyObject *) = NULL; PyObject * (*g)(PyObject *, int) = NULL; - PyObject *x; + PyObject *x = NULL; if (PyInstance_Check(v)) { if (PyInstance_HalfBinOp(v, w, "__imul__", &x, @@ -955,7 +955,7 @@ PyObject * PyNumber_InPlaceDivide(PyObject *v, PyObject *w) { PyObject * (*f)(PyObject *, PyObject *) = NULL; - PyObject *x; + PyObject *x = NULL; if (PyInstance_Check(v)) { if (PyInstance_HalfBinOp(v, w, "__idiv__", &x, @@ -987,7 +987,7 @@ PyObject * PyNumber_InPlaceRemainder(PyObject *v, PyObject *w) { PyObject * (*f)(PyObject *, PyObject *) = NULL; - PyObject *x; + PyObject *x = NULL; if (PyInstance_Check(v)) { if (PyInstance_HalfBinOp(v, w, "__imod__", &x, @@ -1026,7 +1026,7 @@ static PyObject * do_inplace_pow(PyObject *v, PyObject *w) { PyObject * (*f)(PyObject *, PyObject *, PyObject *) = NULL; - PyObject *x; + PyObject *x = NULL; if (PyInstance_Check(v)) { if (PyInstance_HalfBinOp(v, w, "__ipow__", &x, do_pow, 0) <= 0) |