mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-15 04:29:42 +00:00
Fix error handling in Options::Parse
Moved `if (error.Fail())` to correct place to catch all faulty cases such as "unknown or ambiguous option" which was ignored before. llvm-svn: 354883
This commit is contained in:
parent
8cb497027d
commit
f388d17d7c
@ -1436,9 +1436,10 @@ llvm::Expected<Args> Options::Parse(const Args &args,
|
||||
} else {
|
||||
error.SetErrorStringWithFormat("invalid option with value '%i'", val);
|
||||
}
|
||||
}
|
||||
|
||||
if (error.Fail())
|
||||
return error.ToError();
|
||||
}
|
||||
|
||||
argv.erase(argv.begin(), argv.begin() + OptionParser::GetOptionIndex());
|
||||
return ReconstituteArgsAfterParsing(argv, args);
|
||||
|
Loading…
x
Reference in New Issue
Block a user