Browse Source

Fix ResolveResults returned by VisitBitNot and LogicNot

pull/728/head
Siegfried Pammer 10 years ago
parent
commit
ebff022faa
  1. 4
      ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs

4
ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs

@ -278,7 +278,7 @@ namespace ICSharpCode.Decompiler.CSharp
argument = argument.ConvertTo(compatibleType, this); argument = argument.ConvertTo(compatibleType, this);
return new UnaryOperatorExpression(UnaryOperatorType.BitNot, argument) return new UnaryOperatorExpression(UnaryOperatorType.BitNot, argument)
.WithRR(argument.ResolveResult) .WithRR(new OperatorResolveResult(compatibleType, ExpressionType.Not, argument.ResolveResult))
.WithILInstruction(inst) .WithILInstruction(inst)
.ConvertTo(type, this); .ConvertTo(type, this);
} }
@ -286,7 +286,7 @@ namespace ICSharpCode.Decompiler.CSharp
ExpressionWithResolveResult LogicNot(TranslatedExpression expr) ExpressionWithResolveResult LogicNot(TranslatedExpression expr)
{ {
return new UnaryOperatorExpression(UnaryOperatorType.Not, expr.Expression) return new UnaryOperatorExpression(UnaryOperatorType.Not, expr.Expression)
.WithRR(new OperatorResolveResult(compilation.FindType(KnownTypeCode.Boolean), ExpressionType.Not)); .WithRR(new OperatorResolveResult(compilation.FindType(KnownTypeCode.Boolean), ExpressionType.Not, expr.ResolveResult));
} }
readonly HashSet<ILVariable> loadedVariablesSet = new HashSet<ILVariable>(); readonly HashSet<ILVariable> loadedVariablesSet = new HashSet<ILVariable>();

Loading…
Cancel
Save