Browse Source

Fix MayThrow flag on BinaryNumericInstruction

pull/728/merge
Daniel Grunwald 9 years ago
parent
commit
421ad617f8
  1. 2
      ICSharpCode.Decompiler/IL/Instructions/BinaryNumericInstruction.cs
  2. 2
      ICSharpCode.Decompiler/IL/Instructions/CompoundAssignmentInstruction.cs

2
ICSharpCode.Decompiler/IL/Instructions/BinaryNumericInstruction.cs

@ -109,7 +109,7 @@ namespace ICSharpCode.Decompiler.IL @@ -109,7 +109,7 @@ namespace ICSharpCode.Decompiler.IL
public override InstructionFlags DirectFlags {
get {
if (Operator == BinaryNumericOperator.Div || Operator == BinaryNumericOperator.Rem)
if (CheckForOverflow || (Operator == BinaryNumericOperator.Div || Operator == BinaryNumericOperator.Rem))
return base.DirectFlags | InstructionFlags.MayThrow;
return base.DirectFlags;
}

2
ICSharpCode.Decompiler/IL/Instructions/CompoundAssignmentInstruction.cs

@ -91,7 +91,7 @@ namespace ICSharpCode.Decompiler.IL @@ -91,7 +91,7 @@ namespace ICSharpCode.Decompiler.IL
public override InstructionFlags DirectFlags {
get {
var flags = InstructionFlags.SideEffect;
if (Operator == BinaryNumericOperator.Div || Operator == BinaryNumericOperator.Rem)
if (CheckForOverflow || (Operator == BinaryNumericOperator.Div || Operator == BinaryNumericOperator.Rem))
flags |= InstructionFlags.MayThrow;
return flags;
}

Loading…
Cancel
Save