You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Eugene S. Ostrovsky (JIRA)" <ji...@apache.org> on 2007/06/14 15:28:54 UTC
[jira] Updated: (HARMONY-3908) [drlvm][kernel] Drlvm crashes on
Method.invoke(obj, {arg}) if arg extends Number instead of expected
primitive type wrapper
[ https://issues.apache.org/jira/browse/HARMONY-3908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eugene S. Ostrovsky updated HARMONY-3908:
-----------------------------------------
Attachment: H3908-Regression-test.patch
Added patch:
H3908-Regression-test.patch
Regression test for the issue.
> [drlvm][kernel] Drlvm crashes on Method.invoke(obj, {arg}) if arg extends Number instead of expected primitive type wrapper
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-3908
> URL: https://issues.apache.org/jira/browse/HARMONY-3908
> Project: Harmony
> Issue Type: Bug
> Components: DRLVM
> Reporter: Elena Sayapina
> Attachments: H3908-Regression-test.patch, invokeTest.java
>
>
> Drlvm crashes in primitives support if call invoke() method with wrong argument:
> Argument is object of a class extends Number instead of expected object of primitive type wrapper.
> Please, consider the following code:
> import java.lang.reflect.Method;
> public class invokeTest {
> byte b = 0;
>
> public static void main(String[] args) {
> try {
> Method method = invokeTest.class.getDeclaredMethod("test", new Class[] {Byte.TYPE});
> method.invoke(new invokeTest(), new Object[] {new N()});
> System.out.println("TEST FAILED: no exception");
> } catch(IllegalArgumentException e) {
> System.out.println("TEST PASSED: " + e);
> } catch(Exception e) {
> System.out.println("TEST FAILED: unexpected " + e);
> }
> }
>
> public void test(byte b) {
> this.b = b;
> }
> }
> class N extends Number {
>
> public double doubleValue() {
> return 0;
> }
>
> public float floatValue() {
> return 0;
> }
> public int intValue() {
> return 0;
> }
> public long longValue() {
> return 0;
> }
> }
> Output on Harmony-r539255:
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors,
> as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r539255, (May 18 2007), Windows/ia32/msvc 1310, release build
> http://incubator.apache.org/harmony
> Internal error:C:\BT\build\checkouts\drlvm\vm\vmcore\src\jit\primitives_support.cpp:320: Unknown type descriptor
> This application has requested the Runtime to terminate it in an unusual way.
> Please contact the application's support team for more information.
>
> Output on HotSpot:
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)
> TEST PASSED: java.lang.IllegalArgumentException: argument type mismatch
> Please, NOTE that if N doesn't extend any class or extends some class other than Number the test passes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.