[Lldb-commits] [PATCH] D31335: Allow getCompiler to return None in the test suite

Francis Ricci via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 24 08:55:47 PDT 2017

fjricci created this revision.

Prior to r259433, getCompiler could return None without causing a
test suite crash. However, passing a NoneType to realpath will
cause a crash. Prevent this crash by allowing getCompiler to return None.



Index: packages/Python/lldbsuite/test/plugins/builder_base.py
--- packages/Python/lldbsuite/test/plugins/builder_base.py
+++ packages/Python/lldbsuite/test/plugins/builder_base.py
@@ -33,7 +33,7 @@
     """Returns the compiler in effect the test suite is running with."""
     compiler = os.environ.get("CC", "clang")
     compiler = lldbutil.which(compiler)
-    return os.path.realpath(compiler)
+    return os.path.realpath(compiler) if compiler else None
 def getArchFlag():

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31335.92953.patch
Type: text/x-patch
Size: 551 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170324/339ce927/attachment.bin>

More information about the lldb-commits mailing list