You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implement verification of readonly references #57444
Priority:3Work that is nice to havearea-Tools-ILVerificationIssues related to ilverify tool and IL verification in generalhelp wanted[up-for-grabs] Good issue for external contributors
I would like to get some clarification on document from somebody.
Right now inside ILVerify there concept of isReadonly and isPermanentHome.
a. Is isReadonly in the ILVerify correspond to readonly references?
b. What concept represented by the isPermanentHome.
c. How ILVerify represent controlled mutability references? Also not clear what controlled mutability references is.
Also quick glance on the codebase get me puzzled a bit. I do not fully understand what's going on, but looks like verification happens when ILImporter sees instruction. Currently InitOnly error happens when ilverifier find ldsflda/ldflda, for example and if field is readonly have exclusion condition. It seems to me that with readonly ref support I have to check what kind of reference attempted to be assigned, only at stsfld for example, or during call famility. But that seems a bit disruptive to me, so I want to ask if I thinking in right direction and what am I missing.
Is isReadonly in the ILVerify correspond to readonly references?
How ILVerify represent controlled mutability references?
IsReadonly concept in current ILVerify corresponds to controlled mutability references.
What concept represented by the isPermanentHome.
Whether or not the reference can be pointing to stack. The rules for isPermanentHome are very simplistic compared to what's available in C# today.
Also not clear what controlled mutability references is.
Controlled mutability references are explained in ECMA-335. The key difference between controlled mutability references and readonly references is that it is allowed to call non-readonly valuetype instance method on controlled mutability reference, but it is not allowed to call such method on readonly reference.
Priority:3Work that is nice to havearea-Tools-ILVerificationIssues related to ilverify tool and IL verification in generalhelp wanted[up-for-grabs] Good issue for external contributors
Activity
kant2002 commentedon Jan 27, 2025
I would like to get some clarification on document from somebody.
Right now inside ILVerify there concept of
isReadonlyandisPermanentHome.a. Is
isReadonlyin the ILVerify correspond toreadonly references?b. What concept represented by the
isPermanentHome.c. How ILVerify represent
controlled mutability references? Also not clear whatcontrolled mutability referencesis.Also quick glance on the codebase get me puzzled a bit. I do not fully understand what's going on, but looks like verification happens when ILImporter sees instruction. Currently
InitOnlyerror happens when ilverifier findldsflda/ldflda, for example and if field is readonly have exclusion condition. It seems to me that withreadonly refsupport I have to check what kind of reference attempted to be assigned, only atstsfldfor example, or duringcallfamility. But that seems a bit disruptive to me, so I want to ask if I thinking in right direction and what am I missing.jkotas commentedon Jan 28, 2025
IsReadonly concept in current ILVerify corresponds to controlled mutability references.
Whether or not the reference can be pointing to stack. The rules for isPermanentHome are very simplistic compared to what's available in C# today.
Controlled mutability references are explained in ECMA-335. The key difference between controlled mutability references and readonly references is that it is allowed to call non-readonly valuetype instance method on controlled mutability reference, but it is not allowed to call such method on readonly reference.
ilverify: allow ldsflda of initonly static fields outside the cctor (#…
Fix tuple reference storage and certify generic byref forwarding (#5858…