Skip to content

Don't declare rbimpl_check_typeddata as pure#15467

Merged
byroot merged 1 commit intoruby:masterfrom
byroot:fix-rbimpl_check_typeddata
Dec 9, 2025
Merged

Don't declare rbimpl_check_typeddata as pure#15467
byroot merged 1 commit intoruby:masterfrom
byroot:fix-rbimpl_check_typeddata

Conversation

@byroot
Copy link
Member

@byroot byroot commented Dec 9, 2025

[Bug #21771]

It may raise so it's incorrect and can lead to the compiler optimizing the call out.

[Bug #21771]

It may raise so it's incorrect and can lead to the compiler
optimizing the call out.
@byroot byroot enabled auto-merge (rebase) December 9, 2025 17:00
@byroot byroot merged commit 98390d9 into ruby:master Dec 9, 2025
89 of 90 checks passed
@eregon
Copy link
Member

eregon commented Dec 10, 2025

can lead to the compiler optimizing the call out

For my understanding, if the compiler optimizes it out then I guess the compiler has proven it's the fast-path, in that case why is the behavior incorrect?
Is the bug in https://bugs.ruby-lang.org/issues/21771 about a case that would raise? (seems not)

@byroot
Copy link
Member Author

byroot commented Dec 10, 2025

No the problem was that pg was using TypedData_Get_Struct just to type check, it was ignoring the return value, that's what was allowing the call to be optimized out.

It wouldn't have been possible if the return value was used.

@byroot
Copy link
Member Author

byroot commented Dec 10, 2025

@byroot byroot deleted the fix-rbimpl_check_typeddata branch December 10, 2025 21:58
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