From 68af5c2dd7564a30e908497c6c267574ebcb7bf0 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 5 Sep 2020 17:53:45 +0200 Subject: [PATCH] #1796: If TSAB.PrintIntegralValuesAsHex is set, do not use special constant fields. --- ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs index b4f187319..09af3f02c 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs @@ -928,8 +928,11 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax } else { - if (IsSpecialConstant(underlyingType, constantValue, out var expr)) + if (!(PrintIntegralValuesAsHex && underlyingType.IsCSharpPrimitiveIntegerType()) + && IsSpecialConstant(underlyingType, constantValue, out var expr)) + { return expr; + } if (underlyingType.IsKnownType(KnownTypeCode.Double) || underlyingType.IsKnownType(KnownTypeCode.Single)) return ConvertFloatingPointLiteral(underlyingType, constantValue); IType literalType = underlyingType;