Created
February 13, 2017 09:49
-
-
Save srepmub/184b74150178b171893196bf9638643c to your computer and use it in GitHub Desktop.
swig_coverity_convertfunctionptr.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Lib/python/pyrun.swg b/Lib/python/pyrun.swg | |
index ab1237f62..0974f3061 100644 | |
--- a/Lib/python/pyrun.swg | |
+++ b/Lib/python/pyrun.swg | |
@@ -1295,17 +1295,13 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { | |
desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; | |
if (!desc) | |
return SWIG_ERROR; | |
- if (ty) { | |
- swig_cast_info *tc = SWIG_TypeCheck(desc,ty); | |
- if (tc) { | |
- int newmemory = 0; | |
- *ptr = SWIG_TypeCast(tc,vptr,&newmemory); | |
- assert(!newmemory); /* newmemory handling not yet implemented */ | |
- } else { | |
- return SWIG_ERROR; | |
- } | |
+ swig_cast_info *tc = SWIG_TypeCheck(desc,ty); | |
+ if (tc) { | |
+ int newmemory = 0; | |
+ *ptr = SWIG_TypeCast(tc,vptr,&newmemory); | |
+ assert(!newmemory); /* newmemory handling not yet implemented */ | |
} else { | |
- *ptr = vptr; | |
+ return SWIG_ERROR; | |
} | |
return SWIG_OK; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment