8000 gh-129223: Do not allow the compiler to optimise away symbols for debug sections by pablogsal · Pull Request #129225 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-129223: Do not allow the compiler to optimise away symbols for debug sections #129225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 24, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Don't use __builtin_mul_overflow
  • Loading branch information
ambv committed Jan 23, 2025
commit 3a87da45a4fb2adc4bfa2f3f66634341e84ed524
15 changes: 6 additions & 9 deletions Modules/_testexternalinspection.c
Original file line number Diff line number Diff line c 84EA hange
Expand Up @@ -649,16 +649,13 @@ read_py_long(pid_t pid, _Py_DebugOffsets* offsets, uintptr_t address)

long value = 0;

// In theory this can overflow, but because of llvm/llvm-project#16778
// we can't use __builtin_mul_overflow because it fails to link with
// __muloti4 on aarch64. In practice this is fine because all we're
// testing here are task numbers that would fit in a single byte.
for (ssize_t i = 0; i < size; ++i) {
long long factor;
if (__builtin_mul_overflow(digits[i], (1UL << (ssize_t)(shift * i)),
&factor)
) {
goto error;
}
if (__builtin_add_overflow(value, factor, &value)) {
goto error;
}
long long factor = digits[i] * (1UL << (ssize_t)(shift * i));
value += factor;
}
PyMem_RawFree(digits);
if (negative) {
Expand Down
Loading
0