forked from OSchip/llvm-project
[UpdateTestChecks] Error if --llvm-mca-binary gets an empty string
If the command line was mistyped like: ./update_mca_test_checks.py --llvm-mca-binary= /path/to/llvm-mca *.s ^-- extra whitespace then /path/to/llvm-mca would get treated by argparse as a test-path pattern and could actually be opened in write mode and overwritten. llvm-svn: 334029
This commit is contained in:
parent
757600bccb
commit
a9a6d54146
|
@ -77,6 +77,9 @@ def _parse_args():
|
|||
|
||||
_configure_warnings(args)
|
||||
|
||||
if not args.llvm_mca_binary:
|
||||
raise Error('--llvm-mca-binary value cannot be empty string')
|
||||
|
||||
if os.path.basename(args.llvm_mca_binary) != 'llvm-mca':
|
||||
_warn('unexpected binary name: {}'.format(args.llvm_mca_binary))
|
||||
|
||||
|
|
Loading…
Reference in New Issue