8263353: assert(CompilerOracle::option_matches_type(option, value)) failed: Value must match option type
Reviewed-by: neliasso, kvn
This commit is contained in:
parent
cf1c0219ce
commit
ad1f605419
@ -781,7 +781,14 @@ void CompilerOracle::parse_from_line(char* line) {
|
|||||||
print_parse_error(error_buf, original.get());
|
print_parse_error(error_buf, original.get());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
register_command(typed_matcher, option, true);
|
if (option2type(option) == OptionType::Bool) {
|
||||||
|
register_command(typed_matcher, option, true);
|
||||||
|
} else {
|
||||||
|
jio_snprintf(error_buf, sizeof(error_buf), " Missing type '%s' before option '%s'",
|
||||||
|
optiontype2name(option2type(option)), option2name(option));
|
||||||
|
print_parse_error(error_buf, original.get());
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
assert(typed_matcher != NULL, "sanity");
|
assert(typed_matcher != NULL, "sanity");
|
||||||
assert(*error_buf == '\0', "No error here");
|
assert(*error_buf == '\0', "No error here");
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* @test TestInvalidCompileCommand
|
* @test TestInvalidCompileCommand
|
||||||
* @bug 8263206
|
* @bug 8263206 8263353
|
||||||
* @summary Regression tests of -XX:CompileCommand
|
* @summary Regression tests of -XX:CompileCommand
|
||||||
* @library /test/lib
|
* @library /test/lib
|
||||||
* @run driver compiler.oracle.TestInvalidCompileCommand
|
* @run driver compiler.oracle.TestInvalidCompileCommand
|
||||||
@ -40,12 +40,47 @@ public class TestInvalidCompileCommand {
|
|||||||
{
|
{
|
||||||
"-XX:CompileCommand=unknown",
|
"-XX:CompileCommand=unknown",
|
||||||
"-version"
|
"-version"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"-XX:CompileCommand=option,Test::test,TestOptionDouble,3.14",
|
||||||
|
"-version"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"-XX:CompileCommand=option,Test::test,TestOptionInt,3",
|
||||||
|
"-version"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"-XX:CompileCommand=option,Test::test,TestOptionUint,3",
|
||||||
|
"-version"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"-XX:CompileCommand=option,Test::test,TestOptionStr,hello",
|
||||||
|
"-version"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"-XX:CompileCommand=option,Test::test,TestOptionList,hello,world",
|
||||||
|
"-version"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private static final String[][] OUTPUTS = {
|
private static final String[][] OUTPUTS = {
|
||||||
{
|
{
|
||||||
"Unrecognized option 'unknown'"
|
"Unrecognized option 'unknown'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Missing type 'double' before option 'TestOptionDouble'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Missing type 'intx' before option 'TestOptionInt'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Missing type 'uintx' before option 'TestOptionUint'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Missing type 'ccstr' before option 'TestOptionStr'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Missing type 'ccstrlist' before option 'TestOptionList'"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user