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:
parent
aa18c0d302
commit
73389fa4a2
|
@ -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>
|
2004-08-10 Hans Boehm <Hans.Boehm@hp.com>
|
||||||
|
|
||||||
PR libgcj/16662
|
PR libgcj/16662
|
||||||
|
|
|
@ -1096,16 +1096,15 @@ void _Jv_ClassReader::handleField (int field_no,
|
||||||
throw_class_format_error ("duplicate field name");
|
throw_class_format_error ("duplicate field name");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (field->flags & (Modifier::SYNCHRONIZED
|
// At most one of PUBLIC, PRIVATE, or PROTECTED is allowed.
|
||||||
| Modifier::NATIVE
|
|
||||||
| Modifier::INTERFACE
|
|
||||||
| Modifier::ABSTRACT))
|
|
||||||
throw_class_format_error ("erroneous field access flags");
|
|
||||||
|
|
||||||
if (1 < ( ((field->flags & Modifier::PUBLIC) ? 1 : 0)
|
if (1 < ( ((field->flags & Modifier::PUBLIC) ? 1 : 0)
|
||||||
+((field->flags & Modifier::PRIVATE) ? 1 : 0)
|
+((field->flags & Modifier::PRIVATE) ? 1 : 0)
|
||||||
+((field->flags & Modifier::PROTECTED) ? 1 : 0)))
|
+((field->flags & Modifier::PROTECTED) ? 1 : 0)))
|
||||||
throw_class_format_error ("erroneous field access flags");
|
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)
|
if (verify)
|
||||||
|
@ -1256,15 +1255,15 @@ void _Jv_ClassReader::handleMethod
|
||||||
throw_class_format_error ("duplicate method");
|
throw_class_format_error ("duplicate method");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (method->accflags & (Modifier::VOLATILE
|
// At most one of PUBLIC, PRIVATE, or PROTECTED is allowed.
|
||||||
| Modifier::TRANSIENT
|
|
||||||
| Modifier::INTERFACE))
|
|
||||||
throw_class_format_error ("erroneous method access flags");
|
|
||||||
|
|
||||||
if (1 < ( ((method->accflags & Modifier::PUBLIC) ? 1 : 0)
|
if (1 < ( ((method->accflags & Modifier::PUBLIC) ? 1 : 0)
|
||||||
+((method->accflags & Modifier::PRIVATE) ? 1 : 0)
|
+((method->accflags & Modifier::PRIVATE) ? 1 : 0)
|
||||||
+((method->accflags & Modifier::PROTECTED) ? 1 : 0)))
|
+((method->accflags & Modifier::PROTECTED) ? 1 : 0)))
|
||||||
throw_class_format_error ("erroneous method access flags");
|
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.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue