[PATCH] D71030: Tighten the check for Tool name ( ar, nm, dlltool, lib)
Khem Raj via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 4 12:56:05 PST 2019
raj.khem updated this revision to Diff 232193.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71030/new/
https://reviews.llvm.org/D71030
Files:
llvm/tools/llvm-ar/llvm-ar.cpp
Index: llvm/tools/llvm-ar/llvm-ar.cpp
===================================================================
--- llvm/tools/llvm-ar/llvm-ar.cpp
+++ llvm/tools/llvm-ar/llvm-ar.cpp
@@ -1179,16 +1179,16 @@
llvm::InitializeAllAsmParsers();
Stem = sys::path::stem(ToolName);
- if (Stem.contains_lower("dlltool"))
+ if (Stem.endswith("dlltool") || Stem.contains("dlltool-"))
return dlltoolDriverMain(makeArrayRef(argv, argc));
- if (Stem.contains_lower("ranlib"))
+ if (Stem.endswith("ranlib") || Stem.contains("ranlib-"))
return ranlib_main(argc, argv);
- if (Stem.contains_lower("lib"))
+ if (Stem.endswith("lib") || Stem.contains("lib-"))
return libDriverMain(makeArrayRef(argv, argc));
- if (Stem.contains_lower("ar"))
+ if (Stem.endswith("ar") || Stem.contains("ar-"))
return ar_main(argc, argv);
fail("not ranlib, ar, lib or dlltool");
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71030.232193.patch
Type: text/x-patch
Size: 881 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191204/6713144e/attachment.bin>
More information about the llvm-commits
mailing list