JDK-6526806 : DEFINE_ALLOCATE_PERMANENT should check for NULL result
Type:Bug
Component:hotspot
Sub-Component:gc
Affected Version:7
Priority:P3
Status:Resolved
Resolution:Fixed
OS:generic
CPU:generic
Submitted:2007-02-20
Updated:2012-02-01
Resolved:2007-04-24
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
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; \
22-02-2007
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.