Commit 2fb3337d authored by nagayama15's avatar nagayama15

🐛 オプションの値の範囲チェックを忘れていた

parent 16fda2e4
...@@ -32,7 +32,7 @@ namespace ...@@ -32,7 +32,7 @@ namespace
// Returns `true` on error. // Returns `true` on error.
bool parse(llvm::cl::Option& o, llvm::StringRef arg_name, llvm::StringRef arg, RangeOptValue<Integer>& value) bool parse(llvm::cl::Option& o, llvm::StringRef arg_name, llvm::StringRef arg, RangeOptValue<Integer>& value)
{ {
if (arg.getAsInteger(0, value.value)) if (arg.getAsInteger(0, value.value) || value.value < Min || Max < value.value)
{ {
return o.error("invalid argument '" + arg_name + "=" + arg + "'"); return o.error("invalid argument '" + arg_name + "=" + arg + "'");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment