RFR: 8299275: Add some ClassLoaderData verification code

Ioi Lam iklam at openjdk.org
Thu Jan 5 17:12:48 UTC 2023


On Thu, 5 Jan 2023 14:38:07 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> // Verification
>>   virtual void verify_on(outputStream* st);
>>   void verify() { verify_on(tty); }
>> 
>> It calls the virtual function InstanceKlass::verify_on()
>
> Yes, I did add the deallocate_list verification too.  I can change the title of the bug.

This code seem unsafe since you are checking for `is_klass()` but cast to `InstanceKlass*`. Since `verify()` is in `Klass` anyway, it's better to say


 if (m->is_klass()) {
   ((Klass*)m)->verify();

-------------

PR: https://git.openjdk.org/jdk/pull/11856


More information about the hotspot-dev mailing list