summaryrefslogtreecommitdiff
path: root/Include
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-06-14 00:31:21 +0000
committerGuido van Rossum <guido@python.org>2007-06-14 00:31:21 +0000
commita6ba20f101058b0294fa8bd299ff8fde7393ef82 (patch)
tree90e1d880d4efd6d45622b29f4c11756162834b3f /Include
parentc07a8ff9d5e9756af4fc262cc36e992ad0c6065d (diff)
downloadcpython-a6ba20f101058b0294fa8bd299ff8fde7393ef82.tar.gz
Add asserts to PyBytes_AS_STRING and PyBytes_GET_SIZE.
Diffstat (limited to 'Include')
-rw-r--r--Include/bytesobject.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Include/bytesobject.h b/Include/bytesobject.h
index bc385c1dd7..9c1f4ba1b1 100644
--- a/Include/bytesobject.h
+++ b/Include/bytesobject.h
@@ -41,8 +41,8 @@ PyAPI_FUNC(char *) PyBytes_AsString(PyObject *);
PyAPI_FUNC(int) PyBytes_Resize(PyObject *, Py_ssize_t);
/* Macros, trading safety for speed */
-#define PyBytes_AS_STRING(self) (((PyBytesObject *)(self))->ob_bytes)
-#define PyBytes_GET_SIZE(self) (((PyBytesObject *)(self))->ob_size)
+#define PyBytes_AS_STRING(self) (assert(PyBytes_Check(self)),((PyBytesObject *)(self))->ob_bytes)
+#define PyBytes_GET_SIZE(self) (assert(PyBytes_Check(self)),((PyBytesObject *)(self))->ob_size)
#ifdef __cplusplus
}