Skip to content

Simplest fix for bug #8120 : Cast dies with numeric value is out of range error (5.0.1 snapshot)#8129

Merged
hvlad merged 1 commit intomasterfrom
work/gh-8120
May 24, 2024
Merged

Simplest fix for bug #8120 : Cast dies with numeric value is out of range error (5.0.1 snapshot)#8129
hvlad merged 1 commit intomasterfrom
work/gh-8120

Conversation

@hvlad
Copy link
Copy Markdown
Member

@hvlad hvlad commented May 24, 2024

The problem in #8120 is that RetValue updates value in own destructor only, thus making impossible to work with value in the same scope as RetValue.
I found and fixed two occurrences of such code but it looks as fragile to me.
It would be better to not create such indirect dependencies, for example moving RetValue instance into cvt_decompose().

@hvlad hvlad requested a review from AlexPeshkoff May 24, 2024 12:35
@hvlad hvlad linked an issue May 24, 2024 that may be closed by this pull request
@hvlad hvlad merged commit 67a5ca8 into master May 24, 2024
@mrotteveel
Copy link
Copy Markdown
Member

Out of curiosity, why does the introduction of those braces fix this problem?

@hvlad
Copy link
Copy Markdown
Member Author

hvlad commented May 24, 2024

Out of curiosity, why does the introduction of those braces fix this problem?

It set scope for RetValue instance and forces it to update value (passed into ctor) to the correct value (see ~RetValue()) before it will be used further.

@hvlad hvlad deleted the work/gh-8120 branch February 16, 2026 17:35
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.

Cast dies with numeric value is out of range error (5.0.1 snapshot)

3 participants