/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* This file was generated AUTOMATICALLY from a template file Wed Jun 17 10:43:47 PDT 1998 */
/*-
* code for verifying the date in a ClassClass structure for internal
* consistency.
*/
#include "oobj.h"
#include "interpreter.h"
#include "bool.h"
#include "utf.h"
#include "tree.h"
/* Argument for is_legal_fieldname */
{
int i;
return TRUE;
if (!verify_constant_pool(cb))
return FALSE;
/* Make sure all the method names and signatures are okay */
}
/* Make sure all the field names and signatures are okay */
}
/* Make sure we are not overriding any final methods or classes*/
if (cbIsInterface(cb)) {
}
/* Only internal methods can be static */
}
}
}
} else if (cbSuperclass(cb)) {
}
}
}
}
if ((offset > 0)
}
}
} else if (cb != classJavaLangObject) {
}
if (result)
if (result)
return result;
}
static bool_t
{
unsigned char *type_table;
int i, type;
return TRUE;
/* Let's make two quick passes over the constant pool. The first one
* checks that everything is of the right type. */
for (i = 1; i < cp_count; i++) {
switch(type = type_table[i]) {
case CONSTANT_String:
case CONSTANT_Class: {
if ( (index < 1)
return FALSE;
}
break;
}
/* This can only happen if a string is the "initial" value of
* some final static String. We assume that the checking has
* already been done.
*/
break;
case CONSTANT_Fieldref:
case CONSTANT_Methodref:
case CONSTANT_NameAndType: {
return FALSE;
}
if (type == CONSTANT_NameAndType) {
return FALSE;
}
} else {
!= CONSTANT_Class)
return FALSE;
}
}
break;
}
return FALSE;
break;
if ((i + 1 >= cp_count) ||
return FALSE;
} else {
i++;
break;
}
case CONSTANT_Integer:
case CONSTANT_Float:
case CONSTANT_Long:
case CONSTANT_Double:
case CONSTANT_Utf8:
return FALSE;
default:
return FALSE;
}
}
for (i = 1; i < cp_count; i++) {
switch(type = type_table[i]) {
case CONSTANT_Class: {
return FALSE;
break;
}
case CONSTANT_Fieldref:
case CONSTANT_Methodref:
case CONSTANT_InterfaceMethodref: {
if (type == CONSTANT_Fieldref) {
return FALSE;
} else {
return FALSE;
}
break;
}
}
}
return TRUE;
}
/* Return true if the entire second argument consists of a legal fieldname
* (or classname, if the third argument is LegalClass).
*/
static bool_t
{
} else {
char *p;
} else {
}
}
if (!result) {
return FALSE;
} else {
return TRUE;
}
}
/* Return true if the entire string consists of a legal field signature */
static bool_t
{
if (p != 0 && p[0] == '\0') {
return TRUE;
} else {
return FALSE;
}
}
static bool_t
{
char *p = signature;
char *next_p;
/* The first character must be a '(' */
if (*p++ == SIGNATURE_FUNC) {
/* Skip over however many legal field signatures there are */
p = next_p;
/* The first non-signature thing better be a ')' */
if (*p++ == SIGNATURE_ENDFUNC) {
/* All internal methods must return void */
return TRUE;
} else {
/* Now, we better just have a return value. */
return TRUE;
}
}
}
return FALSE;
}
$$Tables
/*
* This code mirrors Character.isJavaIdentifierStart. It determines whether
* the specified character is a legal start of a Java identifier as per JLS.
*
* The parameter ch is the character to be tested; return 1 if the
* character is a letter, 0 otherwise.
*/
/*
* This code mirrors Character.isJavaIdentifierPart. It determines whether
* the specified character is a legal part of a Java identifier as per JLS.
*
* The parameter ch is the character to be tested; return 1 if the
* character is a digit, 0 otherwise.
*/
/* Take pointer to a string. Skip over the longest part of the string that
* could be taken as a fieldname. Allow '/' if slash_okay is TRUE.
*
* Return a pointer to just past the fieldname. Return NULL if no fieldname
* at all was found, or in the case of slash_okay being true, we saw
* consecutive slashes (meaning we were looking for a qualified path but
* found something that was badly-formed).
*/
static char *
{
char *p;
char *old_p = p;
return 0; /* Don't permit consecutive slashes */
} else {
}
} else {
}
}
}
/* Take pointer to a string. Skip over the longest part of the string that
* could be taken as a field signature. Allow "void" if void_okay.
*
* Return a pointer to just past the signature. Return NULL if no legal
* signature is found.
*/
static char *
{
for (;;) {
switch (name[0]) {
case SIGNATURE_VOID:
if (!void_okay) return 0;
/* FALL THROUGH */
case SIGNATURE_BOOLEAN:
case SIGNATURE_BYTE:
case SIGNATURE_CHAR:
case SIGNATURE_SHORT:
case SIGNATURE_INT:
case SIGNATURE_FLOAT:
case SIGNATURE_LONG:
case SIGNATURE_DOUBLE:
return name + 1;
case SIGNATURE_CLASS: {
/* Skip over the classname, if one is there. */
/* The next character better be a semicolon. */
if (p && p[0] == ';')
return p + 1;
return 0;
}
case SIGNATURE_ARRAY:
/* The rest of what's there better be a legal signature. */
name++;
break;
default:
return 0;
}
}
}
static void
{
if (verbose) {
}
}
/* For use from outside the file. Determine if the specified name is legal
* UTF name for a classname.
*
* Note that this routine expects the internal form of qualified classes:
* the dots should have been replaced by slashes.
*/
{
char *p;
if (!allowArrayClass) {
return FALSE;
} else {
/* Everything that's left better be a field signature */
}
} else {
/* skip over the fieldname. Slashes are okay */
}
return (p != 0 && p[0] == '\0');
}