summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/python-wrapper.swig
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-12-14 23:27:53 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-12-14 23:27:53 +0000
commita2b514a3f2f6a9eeffbaf8d23351726ab11e8d96 (patch)
treec866c2fc4d8f86e4b25c5747128a16ae4b181249 /lldb/scripts/Python/python-wrapper.swig
parenta8aa30b620a8e45d9fd6961e2355ef0ec145046a (diff)
downloadbcm5719-llvm-a2b514a3f2f6a9eeffbaf8d23351726ab11e8d96.tar.gz
bcm5719-llvm-a2b514a3f2f6a9eeffbaf8d23351726ab11e8d96.zip
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
Diffstat (limited to 'lldb/scripts/Python/python-wrapper.swig')
-rw-r--r--lldb/scripts/Python/python-wrapper.swig2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/scripts/Python/python-wrapper.swig b/lldb/scripts/Python/python-wrapper.swig
index 787074e7fcb..f6e3afd4c39 100644
--- a/lldb/scripts/Python/python-wrapper.swig
+++ b/lldb/scripts/Python/python-wrapper.swig
@@ -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";
OpenPOWER on IntegriCloud