Skip to content

Conversation

@ferdymercury
Copy link
Collaborator

This Pull request:

Changes or fixes:

even if it becomes negative due to the overflow.

Fixes #17697

Tested that the Python reproducer in #17697 no longer crashes

code = """
struct Foo
{
  enum E {
    BIG = ((unsigned long long)1)<<63
  };
};
"""

import ROOT
ROOT.gInterpreter.Declare (code)

f = ROOT.Foo()
f.BIG
(Foo::E::Foo::E::BIG) : (internal_enum_type_t) -9223372036854775808

Checklist:

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

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.

I suppose this is an okay solution. It would be even better if we could return the correct value (would likely require more significant changes)

@dpiparo
Copy link
Member

dpiparo commented Jan 16, 2026

Do we maybe need a unit test for this?

@github-actions
Copy link

github-actions bot commented Jan 17, 2026

Test Results

    22 files      22 suites   3d 14h 5m 1s ⏱️
 3 812 tests  3 811 ✅ 0 💤 1 ❌
76 723 runs  76 721 ✅ 0 💤 2 ❌

For more details on these failures, see this check.

Results for commit e09b57f.

♻️ This comment has been updated with latest results.

@dpiparo dpiparo assigned pcanal and dpiparo and unassigned pcanal Jan 17, 2026
dpiparo added a commit to ferdymercury/root that referenced this pull request Jan 18, 2026
all the credit goes to ferdymercury.
@dpiparo dpiparo requested a review from bellenot as a code owner January 18, 2026 12:19
@dpiparo
Copy link
Member

dpiparo commented Jan 18, 2026

I added a test and restarted the builds. Let's see how builds go and then we can merge.

@ferdymercury
Copy link
Collaborator Author

test seems to fail on Windows. Maybe internal_enum_type_t has a different size on Windows?

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.

pyroot can trigger clang assertion failure on enum with value too big to fit in int64_t

3 participants