diff options
author | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-13 18:26:00 +0000 |
---|---|---|
committer | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-13 18:26:00 +0000 |
commit | 13ed6f0d5a6af858973fe1b8bc6944d8f26009fd (patch) | |
tree | 4bc5ac5377cb0ba23dab124e8d6916b8709349f9 /libjava | |
parent | 581f26ff77c4243123271c54c89a67f86a50ef5c (diff) | |
download | gcc-13ed6f0d5a6af858973fe1b8bc6944d8f26009fd.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85952 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 8 | ||||
-rw-r--r-- | libjava/defineclass.cc | 21 |
2 files changed, 18 insertions, 11 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 053ffef084a..8a86bc9000d 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -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 diff --git a/libjava/defineclass.cc b/libjava/defineclass.cc index ad40fc8f7fc..5cd6b009be5 100644 --- a/libjava/defineclass.cc +++ b/libjava/defineclass.cc @@ -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. } } |