8332960: ubsan: classListParser.hpp:159:12: runtime error: load of value 2101478704, which is not a valid value for type 'ParseMode'

Reviewed-by: dholmes, mdoerr
This commit is contained in:
Matthias Baesken 2024-05-29 06:41:53 +00:00
parent 9a83dfee14
commit b8ae11e99b

View File

@ -59,7 +59,8 @@ ClassListParser::ClassListParser(const char* file, ParseMode parse_mode) :
_classlist_file(file), _classlist_file(file),
_id2klass_table(INITIAL_TABLE_SIZE, MAX_TABLE_SIZE), _id2klass_table(INITIAL_TABLE_SIZE, MAX_TABLE_SIZE),
_file_input(do_open(file), /* need_close=*/true), _file_input(do_open(file), /* need_close=*/true),
_input_stream(&_file_input) { _input_stream(&_file_input),
_parse_mode(parse_mode) {
log_info(cds)("Parsing %s%s", file, log_info(cds)("Parsing %s%s", file,
parse_lambda_forms_invokers_only() ? " (lambda form invokers only)" : ""); parse_lambda_forms_invokers_only() ? " (lambda form invokers only)" : "");
if (!_file_input.is_open()) { if (!_file_input.is_open()) {
@ -70,7 +71,6 @@ ClassListParser::ClassListParser(const char* file, ParseMode parse_mode) :
_token = _line = nullptr; _token = _line = nullptr;
_interfaces = new (mtClass) GrowableArray<int>(10, mtClass); _interfaces = new (mtClass) GrowableArray<int>(10, mtClass);
_indy_items = new (mtClass) GrowableArray<const char*>(9, mtClass); _indy_items = new (mtClass) GrowableArray<const char*>(9, mtClass);
_parse_mode = parse_mode;
// _instance should only be accessed by the thread that created _instance. // _instance should only be accessed by the thread that created _instance.
assert(_instance == nullptr, "must be singleton"); assert(_instance == nullptr, "must be singleton");