OpenJDK / jdk / jdk
changeset 51057:13ed0d538b89
8206470: Incorrect use of os::lasterror in ClassListParser
Summary: The change is for future-proof the code in case errno gets overwritten inside the allocation logic.
Reviewed-by: dholmes
Contributed-by: patricio.chilano.mateo@oracle.com
author | coleenp |
---|---|
date | Fri, 13 Jul 2018 13:58:17 -0400 |
parents | 3ddf41505d54 |
children | 44c355346475 |
files | src/hotspot/share/classfile/classListParser.cpp |
diffstat | 1 files changed, 2 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/hotspot/share/classfile/classListParser.cpp Sun Jun 03 23:33:00 2018 -0700 +++ b/src/hotspot/share/classfile/classListParser.cpp Fri Jul 13 13:58:17 2018 -0400 @@ -48,14 +48,13 @@ _instance = this; _classlist_file = file; _file = fopen(file, "r"); - _line_no = 0; - _interfaces = new (ResourceObj::C_HEAP, mtClass) GrowableArray<int>(10, true); - if (_file == NULL) { char errmsg[JVM_MAXPATHLEN]; os::lasterror(errmsg, JVM_MAXPATHLEN); vm_exit_during_initialization("Loading classlist failed", errmsg); } + _line_no = 0; + _interfaces = new (ResourceObj::C_HEAP, mtClass) GrowableArray<int>(10, true); } ClassListParser::~ClassListParser() {