src/hotspot/share/classfile/loaderConstraints.cpp
changeset 53776 7c17199fa37d
parent 51959 db0c3952de52
equal deleted inserted replaced
53775:5d20b085d893 53776:7c17199fa37d
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    75   while (*pp) {
    75   while (*pp) {
    76     LoaderConstraintEntry* p = *pp;
    76     LoaderConstraintEntry* p = *pp;
    77     if (p->hash() == hash) {
    77     if (p->hash() == hash) {
    78       if (p->name() == name) {
    78       if (p->name() == name) {
    79         for (int i = p->num_loaders() - 1; i >= 0; i--) {
    79         for (int i = p->num_loaders() - 1; i >= 0; i--) {
    80           if (p->loader_data(i) == loader_data) {
    80           if (p->loader_data(i) == loader_data &&
       
    81               // skip unloaded klasses
       
    82               (p->klass() == NULL ||
       
    83                p->klass()->is_loader_alive())) {
    81             return pp;
    84             return pp;
    82           }
    85           }
    83         }
    86         }
    84       }
    87       }
    85     }
    88     }