United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6526806 DEFINE_ALLOCATE_PERMANENT should check for NULL result
JDK-6526806 : DEFINE_ALLOCATE_PERMANENT should check for NULL result

Details
Type:
Bug
Submit Date:
2007-02-20
Status:
Resolved
Updated Date:
2012-02-01
Project Name:
JDK
Resolved Date:
2007-04-24
Component:
hotspot
OS:
generic
Sub-Component:
gc
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
hs10 (b12)

Related Reports
Backport:
Backport:
Relates:
Relates:

Sub Tasks

Description
The macro DEFINE_ALLOCATE_PERMANENT defined in klass.hpp should
check for a NULL return from an allocation.

                                    

Comments
SUGGESTED FIX

In src/share/vm/oops/klass.hpp

123a124
>     if (result == NULL) return NULL;	\
                                     
2007-02-22
EVALUATION

A recent change in the macro DEFINE_ALLOCATE_PERMANENT (only
in jdk7) did not correctly account for a NULL return from
an allocation call.  The fix is to check the return
from the call to "new" and to return NULL immediately
if the return from "new" was NULL.
                                     
2007-02-22



Hardware and Software, Engineered to Work Together