8260928: InitArrayShortSize constraint func should print a helpful error message

Reviewed-by: shade, chagedorn
This commit is contained in:
Tobias Hartmann 2021-02-03 08:10:21 +00:00
parent cb127a4bb5
commit 91e6c755f3

View File

@ -302,6 +302,9 @@ JVMFlag::Error TypeProfileLevelConstraintFunc(uintx value, bool verbose) {
JVMFlag::Error InitArrayShortSizeConstraintFunc(intx value, bool verbose) {
if (value % BytesPerLong != 0) {
JVMFlag::printError(verbose,
"InitArrayShortSize (" INTX_FORMAT ") must be "
"a multiple of %d\n", value, BytesPerLong);
return JVMFlag::VIOLATES_CONSTRAINT;
} else {
return JVMFlag::SUCCESS;