Skip to content

Commit

Permalink
8281771: Crash in java_lang_invoke_MethodType::print_signature
Browse files Browse the repository at this point in the history
Reviewed-by: dholmes, shade
  • Loading branch information
lmesnik committed Feb 15, 2022
1 parent 1aff44b commit a24498b
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/hotspot/share/classfile/javaClasses.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -4087,11 +4087,20 @@ void java_lang_invoke_MethodType::serialize_offsets(SerializeClosure* f) {
void java_lang_invoke_MethodType::print_signature(oop mt, outputStream* st) {
st->print("(");
objArrayOop pts = ptypes(mt);
for (int i = 0, limit = pts->length(); i < limit; i++) {
java_lang_Class::print_signature(pts->obj_at(i), st);
if (pts != NULL) {
for (int i = 0, limit = pts->length(); i < limit; i++) {
java_lang_Class::print_signature(pts->obj_at(i), st);
}
} else {
st->print("NULL");
}
st->print(")");
java_lang_Class::print_signature(rtype(mt), st);
oop rt = rtype(mt);
if (rt != NULL) {
java_lang_Class::print_signature(rt, st);
} else {
st->print("NULL");
}
}

Symbol* java_lang_invoke_MethodType::as_signature(oop mt, bool intern_if_not_found) {
Expand Down

3 comments on commit a24498b

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheRealMDoerr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on a24498b Mar 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheRealMDoerr the backport was successfully created on the branch TheRealMDoerr-backport-a24498b7 in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit a24498b7 from the openjdk/jdk repository.

The commit being backported was authored by Leonid Mesnik on 15 Feb 2022 and was reviewed by David Holmes and Aleksey Shipilev.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev TheRealMDoerr-backport-a24498b7:TheRealMDoerr-backport-a24498b7
$ git checkout TheRealMDoerr-backport-a24498b7
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev TheRealMDoerr-backport-a24498b7

Please sign in to comment.