Skip to content

Conversation

ferdymercury
Copy link
Collaborator

@ferdymercury ferdymercury commented Aug 11, 2025

This Pull request:

Changes or fixes:

Fixes a alloc-size-larger in TString::Recommend (cap+1) compiler warning often seen in the CI of the PRs. Since Align sums 16 and leads to overflow if close to kMaxInt.

Check warning on line 1294 in core/base/src/TString.cxx
GitHub Actions / fedora42 CMAKE_CXX_STANDARD=23

argument 1 value ‘18446744071562067968’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]

Check warning on line 1294 in core/base/src/TString.cxx
GitHub Actions / fedora43 CMAKE_CXX_STANDARD=23

argument 1 value ‘18446744071562067968’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]

You can reproduce the bug by running:

TString s; s.Append('a', kMaxInt-15);
(bad-alloc)
TString s; s.Append('a', kMaxInt-16);
works fine.

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

This PR fixes #

…Align

Fixes a compiler warning often seen in the CI of the PRs
Copy link

github-actions bot commented Aug 12, 2025

Test Results

    20 files      20 suites   3d 7h 11m 7s ⏱️
 3 257 tests  3 257 ✅ 0 💤 0 ❌
63 493 runs  63 493 ✅ 0 💤 0 ❌

Results for commit ed52211.

♻️ This comment has been updated with latest results.

@ferdymercury ferdymercury changed the title [core] reduce maxsize of string to prevent int overflow when calling Align [core] prevent integer overflow when calling Align Aug 12, 2025
Copy link
Member

@pcanal pcanal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@dpiparo dpiparo merged commit d7f410b into root-project:master Aug 12, 2025
23 of 25 checks passed
@ferdymercury ferdymercury deleted the stringcap branch August 12, 2025 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants