File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ public byte [] InitialValue {
113
113
}
114
114
set {
115
115
initial_value = value ;
116
+ HasFieldRVA = ! initial_value . IsNullOrEmpty ( ) ;
116
117
rva = 0 ;
117
118
}
118
119
}
@@ -245,6 +246,11 @@ public bool HasDefault {
245
246
set { attributes = attributes . SetAttributes ( ( ushort ) FieldAttributes . HasDefault , value ) ; }
246
247
}
247
248
249
+ public bool HasFieldRVA {
250
+ get { return attributes . GetAttributes ( ( ushort ) FieldAttributes . HasFieldRVA ) ; }
251
+ set { attributes = attributes . SetAttributes ( ( ushort ) FieldAttributes . HasFieldRVA , value ) ; }
252
+ }
253
+
248
254
#endregion
249
255
250
256
public override bool IsDefinition {
Original file line number Diff line number Diff line change @@ -122,6 +122,14 @@ public void FieldRVA ()
122
122
Assert . AreEqual ( 2 , buffer . ReadUInt32 ( ) ) ;
123
123
Assert . AreEqual ( 3 , buffer . ReadUInt32 ( ) ) ;
124
124
Assert . AreEqual ( 4 , buffer . ReadUInt32 ( ) ) ;
125
+
126
+ var intialValue = field . InitialValue ;
127
+ field . InitialValue = null ;
128
+ Assert . False ( field . Attributes . HasFlag ( FieldAttributes . HasFieldRVA ) ) ;
129
+
130
+ field . InitialValue = intialValue ;
131
+
132
+ Assert . True ( field . Attributes . HasFlag ( FieldAttributes . HasFieldRVA ) ) ;
125
133
} ) ;
126
134
}
127
135
You can’t perform that action at this time.
0 commit comments