|
|
|
@ -323,6 +323,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
@@ -323,6 +323,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
|
|
|
|
|
ILInstruction replacement; |
|
|
|
|
switch (mode) { |
|
|
|
|
case Mode.ReferenceType: |
|
|
|
|
case Mode.UnconstrainedType: |
|
|
|
|
// Wrap varLoad in nullable.unwrap:
|
|
|
|
|
replacement = new NullableUnwrap(varLoad.ResultType, varLoad, refInput: varLoad.ResultType == StackType.Ref); |
|
|
|
|
break; |
|
|
|
@ -340,10 +341,6 @@ namespace ICSharpCode.Decompiler.IL.Transforms
@@ -340,10 +341,6 @@ namespace ICSharpCode.Decompiler.IL.Transforms
|
|
|
|
|
refInput: true |
|
|
|
|
).WithILRange(varLoad); |
|
|
|
|
break; |
|
|
|
|
case Mode.UnconstrainedType: |
|
|
|
|
// Wrap varLoad in nullable.unwrap:
|
|
|
|
|
replacement = new NullableUnwrap(varLoad.ResultType, varLoad, refInput: varLoad.ResultType == StackType.Ref); |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
throw new ArgumentOutOfRangeException(nameof(mode)); |
|
|
|
|
} |
|
|
|
@ -490,11 +487,6 @@ namespace ICSharpCode.Decompiler.IL.Transforms
@@ -490,11 +487,6 @@ namespace ICSharpCode.Decompiler.IL.Transforms
|
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private bool MatchDefaultValueOrLdNull(ILInstruction inst) |
|
|
|
|
{ |
|
|
|
|
return inst.MatchLdNull() || inst.MatchDefaultValue(out _); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class NullPropagationStatementTransform : IStatementTransform |
|
|
|
|