re PR libgcj/17020 (gij should ignore all reserved method flags)

PR libgcj/17020
	Reported by Robin Green.
	* defineclass.cc (handleField): Don't throw exception on
	unrecognised modifier. Add FIXME comments for spec compliance.
	(handleMethod): Likewise.

From-SVN: r85952
This commit is contained in:
Bryce McKinlay 2004-08-13 18:26:00 +00:00 committed by Bryce McKinlay
parent aa18c0d302
commit 73389fa4a2
2 changed files with 18 additions and 11 deletions

View File

@ -1,3 +1,11 @@
2004-08-13 Bryce McKinlay <mckinlay@redhat.com>
PR libgcj/17020
Reported by Robin Green.
* defineclass.cc (handleField): Don't throw exception on unrecognised
modifier. Add FIXME comments for spec compliance.
(handleMethod): Likewise.
2004-08-10 Hans Boehm <Hans.Boehm@hp.com>
PR libgcj/16662

View File

@ -1096,16 +1096,15 @@ void _Jv_ClassReader::handleField (int field_no,
throw_class_format_error ("duplicate field name");
}
if (field->flags & (Modifier::SYNCHRONIZED
| Modifier::NATIVE
| Modifier::INTERFACE
| Modifier::ABSTRACT))
throw_class_format_error ("erroneous field access flags");
// At most one of PUBLIC, PRIVATE, or PROTECTED is allowed.
if (1 < ( ((field->flags & Modifier::PUBLIC) ? 1 : 0)
+((field->flags & Modifier::PRIVATE) ? 1 : 0)
+((field->flags & Modifier::PROTECTED) ? 1 : 0)))
throw_class_format_error ("erroneous field access flags");
// FIXME: JVM spec S4.5: Verify ACC_FINAL and ACC_VOLATILE are not
// both set. Verify modifiers for interface fields.
}
if (verify)
@ -1256,15 +1255,15 @@ void _Jv_ClassReader::handleMethod
throw_class_format_error ("duplicate method");
}
if (method->accflags & (Modifier::VOLATILE
| Modifier::TRANSIENT
| Modifier::INTERFACE))
throw_class_format_error ("erroneous method access flags");
// At most one of PUBLIC, PRIVATE, or PROTECTED is allowed.
if (1 < ( ((method->accflags & Modifier::PUBLIC) ? 1 : 0)
+((method->accflags & Modifier::PRIVATE) ? 1 : 0)
+((method->accflags & Modifier::PROTECTED) ? 1 : 0)))
throw_class_format_error ("erroneous method access flags");
// FIXME: JVM spec S4.6: if ABSTRACT modifier is set, verify other
// flags are not set. Verify flags for interface methods. Verifiy
// modifiers for initializers.
}
}