--- old/src/share/vm/runtime/arguments.cpp Thu May 15 13:41:15 2014 +++ new/src/share/vm/runtime/arguments.cpp Thu May 15 13:41:15 2014 @@ -580,11 +580,20 @@ // Parses a memory size specification string. static bool atomull(const char *s, julong* result) { julong n = 0; - int args_read = sscanf(s, JULONG_FORMAT, &n); + int args_read = 0; + bool is_hex = false; + // Skip leading 0[xX] for hexadecimal + if (*s =='0' && (*(s+1) == 'x' || *(s+1) == 'X')) { + s += 2; + is_hex = true; + args_read = sscanf(s, JULONG_FORMAT_X, &n); + } else { + args_read = sscanf(s, JULONG_FORMAT, &n); + } if (args_read != 1) { return false; } - while (*s != '\0' && isdigit(*s)) { + while (*s != '\0' && (isdigit(*s) || (is_hex && isxdigit(*s)))) { s++; } // 4705540: illegal if more characters are found after the first non-digit @@ -778,7 +787,7 @@ } } -#define VALUE_RANGE "[-kmgtKMGT0123456789]" +#define VALUE_RANGE "[-kmgtxKMGTX0123456789abcdefABCDEF]" if (sscanf(arg, "%" XSTR(BUFLEN) NAME_RANGE "=" "%" XSTR(BUFLEN) VALUE_RANGE "%c", name, value, &dummy) == 2) { return set_numeric_flag(name, value, origin); }