RFR(XS): 8181377: Capture underlying type for unsafe/unaligned pointers in ClassFileParser
kim.barrett at oracle.com
Thu Jun 1 05:57:53 UTC 2017
> On May 31, 2017, at 5:48 PM, Mikael Vidstedt <mikael.vidstedt at oracle.com> wrote:
> Bug: https://bugs.openjdk.java.net/browse/JDK-8181377 <https://bugs.openjdk.java.net/browse/JDK-8181377>
> Webrev: http://cr.openjdk.java.net/~mikael/webrevs/8181377/webrev.00/hotspot/webrev/ <http://cr.openjdk.java.net/~mikael/webrevs/8181377/webrev.00/hotspot/webrev/>
> Copied from the issue description:
> As part of JDK-8180032 I fixed a problem where ClassFileParser passed around potentially unaligned pointers to various class file data structures, and in some cases dereferenced those unaligned pointers which is not valid in C++. As part of the fix I chose to switch from using typed pointers (like u2*) in favor of void*, to signal that the pointer is not (necessarily) possible to dereference directly. However, by switching to void* the information about the underlying type (u2) is lost, which is unfortunate. The information about the type should be maintained in some way.
> I’ve been playing around with a more generic representation of “unsafe” pointers, but I think it’s a slightly bigger project and meanwhile I don’t want to “lose" the type information, so the suggested change at least addresses the “regression” in information.
More information about the hotspot-runtime-dev