mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8180855: Null pointer dereference in OopMapSet::all_do of oopMap.cpp:394
Check for possible null-point dereference. Reviewed-by: kvn
This commit is contained in:
parent
cd62e1b6a1
commit
73b3420b12
1 changed files with 7 additions and 9 deletions
|
@ -350,16 +350,14 @@ void OopMapSet::all_do(const frame *fr, const RegisterMap *reg_map,
|
|||
omv = oms.current();
|
||||
oop* loc = fr->oopmapreg_to_location(omv.reg(),reg_map);
|
||||
guarantee(loc != NULL, "missing saved register");
|
||||
oop *base_loc = fr->oopmapreg_to_location(omv.content_reg(), reg_map);
|
||||
oop *derived_loc = loc;
|
||||
oop val = *base_loc;
|
||||
if (val == (oop)NULL || Universe::is_narrow_oop_base(val)) {
|
||||
// Ignore NULL oops and decoded NULL narrow oops which
|
||||
// equal to Universe::narrow_oop_base when a narrow oop
|
||||
// implicit null check is used in compiled code.
|
||||
// The narrow_oop_base could be NULL or be the address
|
||||
// of the page below heap depending on compressed oops mode.
|
||||
} else {
|
||||
oop *base_loc = fr->oopmapreg_to_location(omv.content_reg(), reg_map);
|
||||
// Ignore NULL oops and decoded NULL narrow oops which
|
||||
// equal to Universe::narrow_oop_base when a narrow oop
|
||||
// implicit null check is used in compiled code.
|
||||
// The narrow_oop_base could be NULL or be the address
|
||||
// of the page below heap depending on compressed oops mode.
|
||||
if (base_loc != NULL && *base_loc != (oop)NULL && !Universe::is_narrow_oop_base(*base_loc)) {
|
||||
derived_oop_fn(base_loc, derived_loc);
|
||||
}
|
||||
oms.next();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue