|
Ran
|
Jobs
1
|
Files
89
|
Run time
1min
|
Badge
README BADGES
|
push
github
FFI: Prevent sanitizer warning in carith_ptr(). Reported by Sergey Bronnikov. (cherry picked from commit c3b379bf5) The Undefined Behaviour Sanitizer [1] produces a warning about signed integer overflow in the function carith_ptr(), when idx equals INT_MIN in the expression idx = -idx. In practice, negating INT_MIN wraps back to itself instead of producing the correct positive value, leading to incorrect pointer arithmetic in carith_ptr() for MM_sub (pointer subtraction). The patch fixes that by converting idx to unsigned (uintptr_t), computes two's complement negation via bitwise negation + 1 (safe from overflow in unsigned arithmetic), and casts back to ptrdiff_t. This avoids signed overflow entirely and correctly negates even the INT_MIN edge case. The patch follows up the commit 78f4de4d7 ("Avoid negation of signed integers in C that may hold INT*_MIN."). [1]: https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html Sergey Bronnikov: * added the description and the test for the problem Part of tarantool/tarantool#12880
5731 of 6058 branches covered (94.6%)
Branch coverage included in aggregate %.
1 of 1 new or added line in 1 file covered. (100.0%)
24 existing lines in 4 files now uncovered.21854 of 23555 relevant lines covered (92.78%)
3969953.34 hits per line
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 10 |
77.88 |
-1.01% | src/lj_api.c |
| 6 |
88.69 |
-0.5% | src/lj_crecord.c |
| 6 |
77.03 |
-0.55% | src/lj_opt_fold.c |
| 2 |
92.0 |
-0.44% | src/luajit.c |
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 30338820236.1 | 89 |
93.15 |
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
|---|