Review request for 8058313: Mismatch of method descriptor and MethodParameters.parameters_count should cause MalformedParameterException
Eric McCorkle
eric.mccorkle at oracle.com
Thu Oct 30 17:19:53 UTC 2014
There is a test for this, which needs to be added to the jdk repo after
the change has propagated. I have created the following issue to track
this: https://bugs.openjdk.java.net/browse/JDK-8062556
On 10/29/14 18:39, Eric McCorkle wrote:
> Hello,
>
> Please review this fix for parameter reflection which addresses hotspot
> falsely ignoring zero-length MethodParameter attributes. The JVMS
> allows a MethodParameters attribute with parameter_count = 0, and the
> parameter reflection spec states that a MalformedParametersException
> should be thrown if parameter_count does not match the number of real
> parameters to a method. Hotspot currently ignores MethodParameters
> attributes with parameter_count = 0; however, in a case where a (bad)
> MethodParameters attribute has parameter_count = 0, but the method has a
> nonzero number of real parameters, hotspot will return null from
> JVM_GetMethodParameters, the result being that a
> MalformedParametersException is not thrown (rather, the reflection API
> acts like there is no MethodParameters attribute).
>
> This patch causes hotspot to record the fact that a zero-length
> MethodParameters attribute does exist, causing the exception to be
> thrown when it should be.
>
> The bug is here:
> https://bugs.openjdk.java.net/browse/JDK-8058313
>
> The webrev is here:
> http://cr.openjdk.java.net/~emc/8058313/
>
More information about the hotspot-dev
mailing list