[PATCH] D71098: Handle two corner cases in creduce-clang-crash.py
Reid Kleckner via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 5 16:16:40 PST 2019
rnk created this revision.
rnk added a reviewer: akhuang.
Herald added a project: clang.
First, call os.path.normpath on the filename argument. I passed in
./foo-asdf.cpp, and this meant that the script failed to find the
filename, and bad things happened.
Second, call os.path.abspath on binaries. CReduce runs the
interestingness test in a temp dir, so relative paths will not work.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D71098
Files:
clang/utils/creduce-clang-crash.py
Index: clang/utils/creduce-clang-crash.py
===================================================================
--- clang/utils/creduce-clang-crash.py
+++ clang/utils/creduce-clang-crash.py
@@ -30,6 +30,7 @@
print(*args, **kwargs)
def check_file(fname):
+ fname = os.path.normpath(fname)
if not os.path.isfile(fname):
sys.exit("ERROR: %s does not exist" % (fname))
return fname
@@ -40,6 +41,8 @@
or absolute path to cmd_dir/cmd_name.
"""
if cmd_path:
+ # Make the path absolute so the creduce test can be run from any directory.
+ cmd_path = os.path.abspath(cmd_path)
cmd = find_executable(cmd_path)
if cmd:
return cmd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71098.232467.patch
Type: text/x-patch
Size: 669 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191206/f8aafb5c/attachment.bin>
More information about the cfe-commits
mailing list