[Initializer] Integer base conversion is not correct
Closed this issue · 1 comments
DomenicoCacace commented
When parsing integers in base 16, the result in base 10 does not correspond to the original value.
TAFFO/unittests/Initializer/TaffoInitializer/AnnotationParserTest.cpp
Lines 729 to 739 in a1051f8
[ RUN ] AnnotationParserTest.IntegerNoSignBase16
TAFFO/unittests/Initializer/TaffoInitializer/AnnotationParserTest.cpp:738: Failure
Expected: parser.backtrackingDepth
Which is: 2309737967
To be equal to: 81985529216486895
[ FAILED ] AnnotationParserTest.IntegerNoSignBase16 (0 ms)
TAFFO/unittests/Initializer/TaffoInitializer/AnnotationParserTest.cpp
Lines 741 to 751 in a1051f8
[ RUN ] AnnotationParserTest.IntegerPositiveSignBase16
TAFFO/unittests/Initializer/TaffoInitializer/AnnotationParserTest.cpp:750: Failure
Expected: parser.backtrackingDepth
Which is: 2309737967
To be equal to: 81985529216486895
[ FAILED ] AnnotationParserTest.IntegerPositiveSignBase16 (0 ms)
TAFFO/unittests/Initializer/TaffoInitializer/AnnotationParserTest.cpp
Lines 753 to 763 in a1051f8
[ RUN ] AnnotationParserTest.IntegerNegativeSignBase16
TAFFO/unittests/Initializer/TaffoInitializer/AnnotationParserTest.cpp:762: Failure
Expected: parser.backtrackingDepth
Which is: 1985229329
To be equal to: -81985529216486895
[ FAILED ] AnnotationParserTest.IntegerNegativeSignBase16 (0 ms)
danielecattaneo commented
This was only due to truncation to 32 bits due to the use of int/unsigned variables, so this is actually intended behavior.