src/share/vm/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** 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

*** 578,592 **** --- 578,601 ---- } // 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) || (is_hex && isxdigit(*s)))) { s++; } // 4705540: illegal if more characters are found after the first non-digit if (strlen(s) > 1) { return false;
*** 776,786 **** --- 785,795 ---- if (sscanf(arg, "%" XSTR(BUFLEN) NAME_RANGE "=" "%" XSTR(BUFLEN) SIGNED_FP_NUMBER_RANGE "%c", name, value, &dummy) == 2) { return set_fp_numeric_flag(name, value, origin); } } ! #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); } return false;

src/share/vm/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File