Skip to content

Commit 5205715

Browse files
committed
Correctly encode int64 minimum value.
Due to a quirk in C++ int64 minimum value can not be encoded as literal. You need to use INT64_MIN constant.
1 parent ca1c62b commit 5205715

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/cpp/CppGenerator.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,6 +1779,10 @@ private CharSequence generateLiteral(final PrimitiveType type, final String valu
17791779

17801780
case INT64:
17811781
literal = value + "L";
1782+
if (value.equals("-9223372036854775808"))
1783+
{
1784+
literal = "INT64_MIN";
1785+
}
17821786
break;
17831787

17841788
case UINT64:

0 commit comments

Comments
 (0)