8008750: [partfait] Null pointer deference in hotspot/src/share/vm/oops/instanceKlass.hpp

Fix null pointer

Reviewed-by: kvn, coleenp
This commit is contained in:
Morris Meyer 2013-03-05 18:03:36 -08:00
parent 0e378a1283
commit 15108cd14e
2 changed files with 16 additions and 6 deletions

View file

@ -536,7 +536,9 @@ class InstanceKlass: public Klass {
assert(is_anonymous(), "not anonymous");
Klass** addr = (Klass**)adr_host_klass();
assert(addr != NULL, "no reversed space");
*addr = host;
if (addr != NULL) {
*addr = host;
}
}
bool is_anonymous() const {
return (_misc_flags & _misc_is_anonymous) != 0;
@ -758,7 +760,10 @@ class InstanceKlass: public Klass {
void set_implementor(Klass* k) {
assert(is_interface(), "not interface");
Klass** addr = adr_implementor();
*addr = k;
assert(addr != NULL, "null addr");
if (addr != NULL) {
*addr = k;
}
}
int nof_implementors() const {