summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/floatobject.c5
-rw-r--r--Objects/object.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index a832c5d..859abf0 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -17,6 +17,11 @@ extern double fmod(double, double);
extern double pow(double, double);
#endif
+#ifdef _OSF_SOURCE
+/* OSF1 5.1 doesn't make this available with XOPEN_SOURCE_EXTENDED defined */
+extern int finite(double);
+#endif
+
/* Special free list -- see comments for same code in intobject.c. */
#define BLOCK_SIZE 1000 /* 1K less typical malloc overhead */
#define BHEAD_SIZE 8 /* Enough for a 64-bit pointer */
diff --git a/Objects/object.c b/Objects/object.c
index 587e806..0d317b2 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1004,12 +1004,15 @@ PyObject_GenericGetAttr(PyObject *obj, PyObject *name)
dictptr = (PyObject **) ((char *)obj + dictoffset);
dict = *dictptr;
if (dict != NULL) {
+ Py_INCREF(dict);
res = PyDict_GetItem(dict, name);
if (res != NULL) {
Py_INCREF(res);
Py_XDECREF(descr);
+ Py_DECREF(dict);
goto done;
}
+ Py_DECREF(dict);
}
}
@@ -1076,12 +1079,14 @@ PyObject_GenericSetAttr(PyObject *obj, PyObject *name, PyObject *value)
*dictptr = dict;
}
if (dict != NULL) {
+ Py_INCREF(dict);
if (value == NULL)
res = PyDict_DelItem(dict, name);
else
res = PyDict_SetItem(dict, name, value);
if (res < 0 && PyErr_ExceptionMatches(PyExc_KeyError))
PyErr_SetObject(PyExc_AttributeError, name);
+ Py_DECREF(dict);
goto done;
}
}