mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 03:44:55 +00:00 
			
		
		
		
	get rid of assert (size >= 0) now that an explicit if (size < 0) is in the code.
This commit is contained in:
		
							parent
							
								
									36a59b4a08
								
							
						
					
					
						commit
						2ea2968064
					
				
					 3 changed files with 0 additions and 3 deletions
				
			
		| 
						 | 
					@ -160,7 +160,6 @@ PyBytes_FromStringAndSize(const char *bytes, Py_ssize_t size)
 | 
				
			||||||
    PyBytesObject *new;
 | 
					    PyBytesObject *new;
 | 
				
			||||||
    Py_ssize_t alloc;
 | 
					    Py_ssize_t alloc;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    assert(size >= 0);
 | 
					 | 
				
			||||||
    if (size < 0) {
 | 
					    if (size < 0) {
 | 
				
			||||||
        PyErr_SetString(PyExc_SystemError,
 | 
					        PyErr_SetString(PyExc_SystemError,
 | 
				
			||||||
            "Negative size passed to PyBytes_FromStringAndSize");
 | 
					            "Negative size passed to PyBytes_FromStringAndSize");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -55,7 +55,6 @@ PyObject *
 | 
				
			||||||
PyString_FromStringAndSize(const char *str, Py_ssize_t size)
 | 
					PyString_FromStringAndSize(const char *str, Py_ssize_t size)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	register PyStringObject *op;
 | 
						register PyStringObject *op;
 | 
				
			||||||
	assert(size >= 0);
 | 
					 | 
				
			||||||
	if (size < 0) {
 | 
						if (size < 0) {
 | 
				
			||||||
		PyErr_SetString(PyExc_SystemError,
 | 
							PyErr_SetString(PyExc_SystemError,
 | 
				
			||||||
		    "Negative size passed to PyString_FromStringAndSize");
 | 
							    "Negative size passed to PyString_FromStringAndSize");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -466,7 +466,6 @@ PyObject *PyUnicode_FromStringAndSize(const char *u, Py_ssize_t size)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    PyUnicodeObject *unicode;
 | 
					    PyUnicodeObject *unicode;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	assert(size <= 0);
 | 
					 | 
				
			||||||
	if (size < 0) {
 | 
						if (size < 0) {
 | 
				
			||||||
		PyErr_SetString(PyExc_SystemError,
 | 
							PyErr_SetString(PyExc_SystemError,
 | 
				
			||||||
		    "Negative size passed to PyUnicode_FromStringAndSize");
 | 
							    "Negative size passed to PyUnicode_FromStringAndSize");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue