From 4d7fff3625a5149833f01698f2404534fcbab5ed Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 6 Apr 2017 16:07:57 +0200 Subject: [PATCH] keep some string for truncated integer constants --- src/cil.ml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cil.ml b/src/cil.ml index 63da92793..dd29fdcef 100755 --- a/src/cil.ml +++ b/src/cil.ml @@ -2028,7 +2028,12 @@ let kintegerCilint (k: ikind) (i: cilint) : exp = if truncated = BitTruncation && !warnTruncate then ignore (warnOpt "Truncating integer %s to %s" (string_of_cilint i) (string_of_cilint i')); - Const (CInt64(int64_of_cilint i', k, None)) + let str = + if string_of_cilint i <> string_of_cilint i' then + Some (string_of_cilint i) + else None + in + Const (CInt64(int64_of_cilint i', k, str)) (* Construct an integer constant with possible truncation *) let kinteger64 (k: ikind) (i: int64) : exp =