Yes, that’s not a loophole. We just need a new dynamic check on putfield 
against the larval state to exclude fieldwrites in init methods for values that 
are frozen. No new verifier or linkage rule is needed for putfield. It’s a 
surprise. 

> On Aug 22, 2023, at 1:37 PM, Dan Smith <[email protected]> wrote:
> 
> 
>> 
>>> On Aug 22, 2023, at 1:33 PM, Dan Smith <[email protected]> wrote:
>>> 
>>>> On Aug 22, 2023, at 1:02 PM, John Rose <[email protected]> wrote:
>>> 
>>>> - putfield is a verifier error on non-identity class types, it only works 
>>>> on uninitializedThis
>>> Alternatively, we don’t need to touch the verifier if we use a dynamic
>>> larval-bit check on putfield.
>> 
>> Okay, but FWIW, we need verification to restrict putfield anyway: outside of 
>> <init>, putfield on a value class field is a verification error.
> 
> 
> Err, spoke too soon, please ignore. I checked the spec and actually this is 
> enforced via the 'final' linkage check, not anything in verification.

Reply via email to