[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-hotspot-runtime-dev
Subject:    Re: Confusion about stack map verify of constructors
From:       David Holmes <david.holmes () oracle ! com>
Date:       2021-06-29 20:53:05
Message-ID: c56d06fa-b7d7-a150-c3ca-0e868ff93954 () oracle ! com
[Download RAW message or body]

Hi,

On 29/06/2021 5:57 pm, NekoCaffeine wrote:
> Hi everyone,
> 
> 
> When a super constructor is called in a TryCatchBlock,
> &nbsp;none of the following exception handler locals will pass validation,
> &nbsp;uninitializedThis, referenceName, TOP, <empty&gt;, java/lang/Object.

This is a deliberate design decision in the language. You are not 
allowed to put a super constructor call in a try/catch because it would 
result in partially constructed objects. If you super constructor fails 
by throwing an exception then your constructor must also fail by 
throwing the exception.

Cheers,
David

> 
> Where uninitializedThis and referenceName are mutually exclusive,
> &nbsp;and either one will fail because it does not contain the other.
> TOP will fail because it is not compatible with the flags of uninitializedThis.
> <empty&gt; will fail for incompatibility with uninitializedThis.
> 
> 
> Is there a stackframe that passes validation?
> 
> 
> Thanks in advance,
> NekoCaffeine
> 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic