summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-07-21 05:29:58 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-07-21 05:29:58 (GMT)
commit48808a1d6c3996ed06e904becdfb4cfadbef09cb (patch)
treed261edceeaa02933a83d6090b9120557a956159b /Objects
parentdc57936b63043ad4f1bbb85e91399b02b7b22f21 (diff)
downloadcpython-48808a1d6c3996ed06e904becdfb4cfadbef09cb.zip
cpython-48808a1d6c3996ed06e904becdfb4cfadbef09cb.tar.gz
cpython-48808a1d6c3996ed06e904becdfb4cfadbef09cb.tar.bz2
Add some asserts that we got good params passed
Diffstat (limited to 'Objects')
-rw-r--r--Objects/dictobject.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index c02f1b2..705be07 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -599,6 +599,8 @@ PyDict_SetItem(register PyObject *op, PyObject *key, PyObject *value)
PyErr_BadInternalCall();
return -1;
}
+ assert(key);
+ assert(value);
mp = (dictobject *)op;
if (PyString_CheckExact(key)) {
hash = ((PyStringObject *)key)->ob_shash;
@@ -647,6 +649,7 @@ PyDict_DelItem(PyObject *op, PyObject *key)
PyErr_BadInternalCall();
return -1;
}
+ assert(key);
if (!PyString_CheckExact(key) ||
(hash = ((PyStringObject *) key)->ob_shash) == -1) {
hash = PyObject_Hash(key);