bytedance / sonic-cpp

A fast JSON serializing & deserializing library, accelerated by SIMD.
Apache License 2.0
835 stars 101 forks source link

fix: to_bitmask return uint32_t to avoid sign extend int to uint64 #83

Closed xiegx94 closed 10 months ago

xiegx94 commented 10 months ago

There is a bug in SkipString that caused by cast int to uint64.

codecov-commenter commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (6fabefe) 95.77% compared to head (9ba094f) 95.77%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #83 +/- ## ======================================= Coverage 95.77% 95.77% ======================================= Files 21 21 Lines 2435 2435 ======================================= Hits 2332 2332 Misses 103 103 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

qshanz373 commented 10 months ago

int _mm_movemask_epi8(__m128i a)

Shall we do the zext at the place that we call it, instead of changing the return type ?

xiegx94 commented 10 months ago

int _mm_movemask_epi8(__m128i a)

Shall we do the zext at the place that we call it, instead of changing the return type ?

Sonic has some to_bitmask functions and all of them should return same sign or unsign type.