mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
8363928: Specifying AOTCacheOutput with a blank path causes the JVM to crash
Reviewed-by: kvn, iklam
This commit is contained in:
parent
c239c0ab00
commit
ea754316fd
@ -121,6 +121,7 @@
|
||||
\
|
||||
product(ccstr, AOTCacheOutput, nullptr, \
|
||||
"Specifies the file name for writing the AOT cache") \
|
||||
constraint(AOTCacheOutputConstraintFunc, AtParse) \
|
||||
\
|
||||
product(bool, AOTInvokeDynamicLinking, false, DIAGNOSTIC, \
|
||||
"AOT-link JVM_CONSTANT_InvokeDynamic entries in cached " \
|
||||
|
||||
@ -39,6 +39,14 @@ JVMFlag::Error AOTCacheConstraintFunc(ccstr value, bool verbose) {
|
||||
return JVMFlag::SUCCESS;
|
||||
}
|
||||
|
||||
JVMFlag::Error AOTCacheOutputConstraintFunc(ccstr value, bool verbose) {
|
||||
if (value == nullptr) {
|
||||
JVMFlag::printError(verbose, "AOTCacheOutput cannot be empty\n");
|
||||
return JVMFlag::VIOLATES_CONSTRAINT;
|
||||
}
|
||||
return JVMFlag::SUCCESS;
|
||||
}
|
||||
|
||||
JVMFlag::Error AOTConfigurationConstraintFunc(ccstr value, bool verbose) {
|
||||
if (value == nullptr) {
|
||||
JVMFlag::printError(verbose, "AOTConfiguration cannot be empty\n");
|
||||
|
||||
@ -35,6 +35,7 @@
|
||||
|
||||
#define RUNTIME_CONSTRAINTS(f) \
|
||||
f(ccstr, AOTCacheConstraintFunc) \
|
||||
f(ccstr, AOTCacheOutputConstraintFunc) \
|
||||
f(ccstr, AOTConfigurationConstraintFunc) \
|
||||
f(ccstr, AOTModeConstraintFunc) \
|
||||
f(int, ObjectAlignmentInBytesConstraintFunc) \
|
||||
|
||||
@ -484,6 +484,7 @@ public class AOTFlags {
|
||||
testEmptyValue("AOTCache");
|
||||
testEmptyValue("AOTConfiguration");
|
||||
testEmptyValue("AOTMode");
|
||||
testEmptyValue("AOTCacheOutput");
|
||||
}
|
||||
|
||||
static void testEmptyValue(String option) throws Exception {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user