8122937: [JEP 245] Validate JVM Command-Line Flag Arguments

Validate the arguments to all JVM command-line flags so as to avoid crashes, and ensure that appropriate error messages are displayed when they are invalid.

Reviewed-by: ddmitriev, dholmes, kbarrett, drwhite, brutisso, coleenp
This commit is contained in:
Gerard Ziemski 2015-06-18 14:39:38 -05:00
parent ac072b303d
commit ed2bb8c9fc
49 changed files with 2843 additions and 938 deletions

View file

@ -29,6 +29,7 @@
#include "interpreter/bytecodes.hpp"
#include "memory/universe.hpp"
#include "prims/methodHandles.hpp"
#include "runtime/globals.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/icache.hpp"
#include "runtime/init.hpp"
@ -141,8 +142,8 @@ jint init_globals() {
// All the flags that get adjusted by VM_Version_init and os::init_2
// have been set so dump the flags now.
if (PrintFlagsFinal) {
CommandLineFlags::printFlags(tty, false);
if (PrintFlagsFinal || PrintFlagsRanges) {
CommandLineFlags::printFlags(tty, false, PrintFlagsRanges);
}
return JNI_OK;