Skip to content

Commit

Permalink
8244495: Some jlink tests crash on Windows after JDK-8237750
Browse files Browse the repository at this point in the history
Fix of 8237750 changed the loading zip library to on-demand loading, on Windows, jlink/jimage still assume that zip has been loaded already. Fix to load zip on not loaded.

Reviewed-by: kbarrett, mchung, dholmes, dcubed
  • Loading branch information
yminqi committed May 7, 2020
1 parent 6dd8443 commit 0ef6d1d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/java.base/share/native/libjimage/imageDecompressor.cpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -61,7 +61,10 @@ static void* findEntry(const char* name) {
#ifdef WIN32
HMODULE handle = GetModuleHandle("zip.dll");
if (handle == NULL) {
return NULL;
handle = LoadLibrary("zip.dll");
}
if (handle == NULL) {
return NULL;
}
addr = (void*) GetProcAddress(handle, name);
return addr;
Expand Down

0 comments on commit 0ef6d1d

Please sign in to comment.