diff options
author | Jim Ingham <jingham@apple.com> | 2016-03-11 18:49:38 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2016-03-11 18:49:38 +0000 |
commit | c134810cfb91716554177992c4bbbf2543545a1a (patch) | |
tree | c04c1a0d8011b0db39e59736717701d212e323bd /lldb/scripts/Python | |
parent | 4661b39e33aae6d9a9fa29c86d3f35e65c4e9005 (diff) | |
download | bcm5719-llvm-c134810cfb91716554177992c4bbbf2543545a1a.tar.gz bcm5719-llvm-c134810cfb91716554177992c4bbbf2543545a1a.zip |
Check for a NULL input filehandle before referencing it.
<rdar://problem/25105824>
llvm-svn: 263274
Diffstat (limited to 'lldb/scripts/Python')
-rw-r--r-- | lldb/scripts/Python/python-typemaps.swig | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lldb/scripts/Python/python-typemaps.swig b/lldb/scripts/Python/python-typemaps.swig index 1b2afc2c7a6..02972ce0925 100644 --- a/lldb/scripts/Python/python-typemaps.swig +++ b/lldb/scripts/Python/python-typemaps.swig @@ -536,14 +536,17 @@ char mode[4] = {0}; #ifdef __APPLE__ int i = 0; - short flags = $1->_flags; - - if (flags & __SRD) - mode[i++] = 'r'; - else if (flags & __SWR) - mode[i++] = 'w'; - else // if (flags & __SRW) - mode[i++] = 'a'; + if ($1) + { + short flags = $1->_flags; + + if (flags & __SRD) + mode[i++] = 'r'; + else if (flags & __SWR) + mode[i++] = 'w'; + else // if (flags & __SRW) + mode[i++] = 'a'; + } #endif using namespace lldb_private; File file($1, false); |