mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8009531: Crash when redefining class with annotated method
Neglected to copy the annotations in clone_with_new_data when they were moved to ConstMethod. Reviewed-by: acorn, sspitsyn, dcubed
This commit is contained in:
parent
087b089a1f
commit
878c7e4cd0
3 changed files with 25 additions and 0 deletions
|
@ -363,6 +363,26 @@ AnnotationArray** ConstMethod::default_annotations_addr() const {
|
|||
return (AnnotationArray**)constMethod_end() - offset;
|
||||
}
|
||||
|
||||
// copy annotations from 'cm' to 'this'
|
||||
void ConstMethod::copy_annotations_from(ConstMethod* cm) {
|
||||
if (cm->has_method_annotations()) {
|
||||
assert(has_method_annotations(), "should be allocated already");
|
||||
set_method_annotations(cm->method_annotations());
|
||||
}
|
||||
if (cm->has_parameter_annotations()) {
|
||||
assert(has_parameter_annotations(), "should be allocated already");
|
||||
set_parameter_annotations(cm->parameter_annotations());
|
||||
}
|
||||
if (cm->has_type_annotations()) {
|
||||
assert(has_type_annotations(), "should be allocated already");
|
||||
set_type_annotations(cm->type_annotations());
|
||||
}
|
||||
if (cm->has_default_annotations()) {
|
||||
assert(has_default_annotations(), "should be allocated already");
|
||||
set_default_annotations(cm->default_annotations());
|
||||
}
|
||||
}
|
||||
|
||||
// Printing
|
||||
|
||||
void ConstMethod::print_on(outputStream* st) const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue