mirror of
https://github.com/intel/llvm.git
synced 2026-01-13 19:08:21 +08:00
Add more robustness - use PyString_CheckExact(pvalue) to check whether pvalue is a Python string before
calling PyString_AsString(pvalue). Similar to http://llvm.org/viewvc/llvm-project?rev=146584&view=rev. llvm-svn: 146606
This commit is contained in:
@@ -234,7 +234,7 @@ LLDBSwigPythonCallTypeScript
|
||||
|
||||
if (pvalue != NULL)
|
||||
{
|
||||
if (pvalue != Py_None)
|
||||
if (pvalue != Py_None && PyString_CheckExact(pvalue))
|
||||
retval = std::string(PyString_AsString(pvalue));
|
||||
else
|
||||
retval = "None";
|
||||
|
||||
Reference in New Issue
Block a user