Browse Source

#2294: Fix potential NRE: finalStore is accessed before null check.

pull/2308/head
Siegfried Pammer 5 years ago
parent
commit
67be41a998
  1. 2
      ICSharpCode.Decompiler/IL/Transforms/TransformArrayInitializers.cs

2
ICSharpCode.Decompiler/IL/Transforms/TransformArrayInitializers.cs

@ -258,9 +258,9 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -258,9 +258,9 @@ namespace ICSharpCode.Decompiler.IL.Transforms
if (otherLoadOfV == null)
return false;
finalStore = otherLoadOfV.Parent.Extract();
value = ((StLoc)finalStore.StoreInstructions[0]).Value;
if (finalStore == null)
return false;
value = ((StLoc)finalStore.StoreInstructions[0]).Value;
}
var fd = context.PEFile.Metadata.GetFieldDefinition((FieldDefinitionHandle)field.MetadataToken);
if (!fd.HasFlag(System.Reflection.FieldAttributes.HasFieldRVA))

Loading…
Cancel
Save