mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8345390: [ubsan] systemDictionaryShared.cpp:964: member call on null pointer
Reviewed-by: mbaesken, kbarrett
This commit is contained in:
parent
eff20a38c7
commit
0b9e749f54
@ -957,11 +957,17 @@ InstanceKlass* SystemDictionaryShared::get_shared_lambda_proxy_class(InstanceKla
|
||||
Symbol* method_type,
|
||||
Method* member_method,
|
||||
Symbol* instantiated_method_type) {
|
||||
assert(caller_ik != nullptr, "sanity");
|
||||
assert(invoked_name != nullptr, "sanity");
|
||||
assert(invoked_type != nullptr, "sanity");
|
||||
assert(method_type != nullptr, "sanity");
|
||||
assert(instantiated_method_type != nullptr, "sanity");
|
||||
|
||||
if (!caller_ik->is_shared() ||
|
||||
!invoked_name->is_shared() ||
|
||||
!invoked_type->is_shared() ||
|
||||
!method_type->is_shared() ||
|
||||
!member_method->is_shared() ||
|
||||
(member_method != nullptr && !member_method->is_shared()) ||
|
||||
!instantiated_method_type->is_shared()) {
|
||||
// These can't be represented as u4 offset, but we wouldn't have archived a lambda proxy in this case anyway.
|
||||
return nullptr;
|
||||
|
||||
@ -61,13 +61,14 @@ public class LambdaInvokeVirtual {
|
||||
.setArchiveName(archiveName);
|
||||
CDSTestUtils.createArchiveAndCheck(opts);
|
||||
|
||||
// run with archive
|
||||
// run with archive; make sure the lambda is loaded from the archive
|
||||
CDSOptions runOpts = (new CDSOptions())
|
||||
.addPrefix("-cp", appJar)
|
||||
.addPrefix("-cp", appJar, "-Xlog:class+load")
|
||||
.setArchiveName(archiveName)
|
||||
.setUseVersion(false)
|
||||
.addSuffix(mainClass);
|
||||
OutputAnalyzer output = CDSTestUtils.runWithArchive(runOpts);
|
||||
output.shouldMatch("LambdaInvokeVirtualApp[$][$]Lambda/.*source: shared objects file");
|
||||
output.shouldHaveExitValue(0);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user