Skip to content

Commit c5b488f

Browse files
committed
Remove flags from box that indicate memory access and ability to throw
1 parent 8ac2841 commit c5b488f

File tree

2 files changed

+1
-20
lines changed

2 files changed

+1
-20
lines changed

ICSharpCode.Decompiler/IL/Instructions.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ public ILInstruction Argument {
318318
set {
319319
ValidateChild(value);
320320
SetChildInstruction(ref this.argument, value, 0);
321-
InvalidateFlags();
322321
}
323322
}
324323
protected sealed override int GetChildCount()
@@ -4356,24 +4355,6 @@ public IType Type {
43564355
set { type = value; InvalidateFlags(); }
43574356
}
43584357
public override StackType ResultType { get { return StackType.O; } }
4359-
protected override InstructionFlags ComputeFlags()
4360-
{
4361-
var baseFlags = base.ComputeFlags();
4362-
if (baseFlags == InstructionFlags.None && Type.Equals(Argument.InferType(null)))
4363-
{
4364-
return InstructionFlags.None;
4365-
}
4366-
return baseFlags | InstructionFlags.SideEffect | InstructionFlags.MayThrow;
4367-
}
4368-
public override InstructionFlags DirectFlags {
4369-
get {
4370-
if (Flags == InstructionFlags.None)
4371-
{
4372-
return InstructionFlags.None;
4373-
}
4374-
return base.DirectFlags | InstructionFlags.SideEffect | InstructionFlags.MayThrow;
4375-
}
4376-
}
43774358
public override void WriteTo(ITextOutput output, ILAstWritingOptions options)
43784359
{
43794360
WriteILRange(output, options);

ICSharpCode.Decompiler/IL/Instructions.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@
266266
CustomInvariant("CheckTargetSlot();")),
267267

268268
new OpCode("box", "Boxes a value.",
269-
Unary, HasTypeOperand, MemoryAccess, MayThrow, ResultType("O")),
269+
Unary, HasTypeOperand, ResultType("O")),
270270
new OpCode("unbox", "Compute address inside box.",
271271
Unary, HasTypeOperand, MayThrow, ResultType("Ref")),
272272
new OpCode("unbox.any", "Unbox a value.",

0 commit comments

Comments
 (0)