# HG changeset patch # User iklam # Date 1471014872 -3600 # Node ID 91ddf30089070bc1b335fc0a3c2808a92e1707b6 # Parent edbb67d8d46d5704249383c5fe218cc6e67a3777 8150752: Share Class Data Reviewed-by: acorn, hseigel, mschoene diff -r edbb67d8d46d -r 91ddf3008907 src/share/vm/classfile/systemDictionary.cpp --- a/src/share/vm/classfile/systemDictionary.cpp Wed May 11 12:03:46 2016 -0400 +++ b/src/share/vm/classfile/systemDictionary.cpp Fri Aug 12 16:14:32 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1220,8 +1220,13 @@ if (ik->super() != NULL) { Symbol* cn = ik->super()->klass_part()->name(); - resolve_super_or_fail(class_name, cn, - class_loader, Handle(), true, CHECK_(nh)); + klassOop s = resolve_super_or_fail(class_name, cn, + class_loader, Handle(), true, CHECK_(nh)); + if (s->klass_part() != ik->super()->klass_part()) { + // The dynamically resolved super class is not the same as the one we used during dump time, + // so we cannot use ik. + return nh; + } } objArrayHandle interfaces (THREAD, ik->local_interfaces()); @@ -1234,7 +1239,12 @@ // reinitialized yet (they will be once the interface classes // are loaded) Symbol* name = k->klass_part()->name(); - resolve_super_or_fail(class_name, name, class_loader, Handle(), false, CHECK_(nh)); + klassOop i = resolve_super_or_fail(class_name, name, class_loader, Handle(), false, CHECK_(nh)); + if (k->klass_part() != i->klass_part()) { + // The dynamically resolved interface class is not the same as the one we used during dump time, + // so we cannot use i. + return nh; + } } // Adjust methods to recover missing data. They need addresses for