hotspot/test/runtime/classFileParserBug/clinitArg.jasm
author hseigel
Tue, 10 Nov 2015 08:42:53 -0500
changeset 33799 77ebbd9b0ecc
permissions -rw-r--r--
8139164: JVM should throw ClassFormatError for non-void methods named <clinit> Summary: If method being parsed is named <clinit>, throw ClassFormatError if it is not void or has arguments, for class file version >= 51. Reviewed-by: acorn, lfoltan
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33799
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
     1
/*
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
     2
 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
     4
 *
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
     7
 * published by the Free Software Foundation.
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
     8
 *
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    13
 * accompanied this code).
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    14
 *
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    18
 *
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    21
 * questions.
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    22
 *
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    23
 */
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    24
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    25
// This class contains a <clinit> method with signature: (I)V.  The JVM should
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    26
// not throw ClassFormatError because methods named <clinit> that have arguments
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    27
// are not illegal in class file versions < 51.
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    28
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    29
public class clinitArg version 50:0
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    30
{
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    31
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    32
    public static Method "<clinit>":"(I)V"
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    33
    stack 1 locals 1
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    34
    {
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    35
        iconst_0;
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    36
        return;
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    37
    }
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    38
77ebbd9b0ecc 8139164: JVM should throw ClassFormatError for non-void methods named <clinit>
hseigel
parents:
diff changeset
    39
} // end Class clinitArg