diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/jib/c_backend.ml | 6 | ||||
| -rw-r--r-- | src/jib/c_codegen.ml | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/jib/c_backend.ml b/src/jib/c_backend.ml index c38749f3..5947b500 100644 --- a/src/jib/c_backend.ml +++ b/src/jib/c_backend.ml @@ -1212,7 +1212,11 @@ let rec sgen_value = function | VL_bits ([], _) -> "UINT64_C(0)" | VL_bits (bs, true) -> "UINT64_C(" ^ Sail2_values.show_bitlist bs ^ ")" | VL_bits (bs, false) -> "UINT64_C(" ^ Sail2_values.show_bitlist (List.rev bs) ^ ")" - | VL_int i -> Big_int.to_string i ^ "l" + | VL_int i -> + if Big_int.equal i (min_int 64) then + "INT64_MIN" + else + "INT64_C(" ^ Big_int.to_string i ^ ")" | VL_bool true -> "true" | VL_bool false -> "false" | VL_unit -> "UNIT" diff --git a/src/jib/c_codegen.ml b/src/jib/c_codegen.ml index 80d4e847..05abfe70 100644 --- a/src/jib/c_codegen.ml +++ b/src/jib/c_codegen.ml @@ -322,7 +322,11 @@ let rec sgen_value = function | VL_bits ([], _) -> "UINT64_C(0)" | VL_bits (bs, true) -> "UINT64_C(" ^ Sail2_values.show_bitlist bs ^ ")" | VL_bits (bs, false) -> "UINT64_C(" ^ Sail2_values.show_bitlist (List.rev bs) ^ ")" - | VL_int i -> Big_int.to_string i ^ "l" + | VL_int i -> + if Big_int.equal i (min_int 64) then + "INT64_MIN" + else + "INT64_C(" ^ Big_int.to_string i ^ ")" | VL_bool true -> "true" | VL_bool false -> "false" | VL_unit -> "UNIT" |
