Skip to content

Commit

Permalink
Add asserts to PyBytes_AS_STRING and PyBytes_GET_SIZE.
Browse files Browse the repository at this point in the history
  • Loading branch information
gvanrossum committed Jun 14, 2007
1 parent 27ff74d commit 2d28f59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Include/bytesobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 2d28f59

Please sign in to comment.