ITADN

Fix(MemoryTrunk.DefragTwoRegion): Unsigned difference expression compared to zero

#385Pull Requestodaysec 创建于 2025-05-28
O
odayseccommented
https://github.com/microsoft/GraphEngine/blob/e3c0e1946d5a49612ac394593de8145594efbdc5/src/Trinity.C/src/Storage/MemoryTrunk/MemoryTrunk.DefragTwoRegion.cpp#L43-L43 Fix the issue the result of the subtraction `hole_right_offset - _bwd_cell_offset - _bwd_cell_size` should be cast to a signed type (e.g., `int64_t`) before performing the comparison. This ensures that the subtraction can produce negative values, and the comparison `> 0` will behave as intended. **Steps to fix:** 1. Cast the result of the subtraction to `int64_t` before performing the comparison. 2. Ensure that the cast does not affect other parts of the code or introduce unintended side effects. ---
合并状态:未合并 关闭于 2025-09-17 0 条评论