diff options
author | Levi Broderick <GrabYourPitchforks@users.noreply.github.com> | 2019-05-15 23:15:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-15 23:15:23 -0700 |
commit | 5ad457b6c1562907e81936a67955c98cf4034857 (patch) | |
tree | b1dc2211afcfb7e8c3c8d797206498bbe50e9a31 | |
parent | e91e7d81d4c02dfa93f7178c8df3e35a112fd3ab (diff) | |
download | coreclr-5ad457b6c1562907e81936a67955c98cf4034857.tar.gz coreclr-5ad457b6c1562907e81936a67955c98cf4034857.tar.bz2 coreclr-5ad457b6c1562907e81936a67955c98cf4034857.zip |
Make Label and OpCode readonly and IEquatable (#24360)
-rw-r--r-- | src/System.Private.CoreLib/shared/System/Reflection/Emit/Label.cs | 4 | ||||
-rw-r--r-- | src/System.Private.CoreLib/shared/System/Reflection/Emit/Opcode.cs | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/System.Private.CoreLib/shared/System/Reflection/Emit/Label.cs b/src/System.Private.CoreLib/shared/System/Reflection/Emit/Label.cs index 676d926e0a..b3cacf5d43 100644 --- a/src/System.Private.CoreLib/shared/System/Reflection/Emit/Label.cs +++ b/src/System.Private.CoreLib/shared/System/Reflection/Emit/Label.cs @@ -22,9 +22,9 @@ namespace System.Reflection.Emit // is passed to the MethodWriter. // Labels are created by using ILGenerator.CreateLabel and their position is set // by using ILGenerator.MarkLabel. - public struct Label : IEquatable<Label> + public readonly struct Label : IEquatable<Label> { - internal int m_label; + internal readonly int m_label; //public Label() { // m_label=0; diff --git a/src/System.Private.CoreLib/shared/System/Reflection/Emit/Opcode.cs b/src/System.Private.CoreLib/shared/System/Reflection/Emit/Opcode.cs index c0e96e6089..a2d5792c6a 100644 --- a/src/System.Private.CoreLib/shared/System/Reflection/Emit/Opcode.cs +++ b/src/System.Private.CoreLib/shared/System/Reflection/Emit/Opcode.cs @@ -6,7 +6,7 @@ using System.Threading; namespace System.Reflection.Emit { - public struct OpCode + public readonly struct OpCode : IEquatable<OpCode> { // // Use packed bitfield for flags to avoid code bloat @@ -33,8 +33,8 @@ namespace System.Reflection.Emit internal const int StackChangeShift = 28; // XXXX0000000000000000000000000000 - private OpCodeValues m_value; - private int m_flags; + private readonly OpCodeValues m_value; + private readonly int m_flags; internal OpCode(OpCodeValues value, int flags) { |