summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/scripts/Python')
-rw-r--r--lldb/scripts/Python/python-typemaps.swig19
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);
OpenPOWER on IntegriCloud