Skip to content
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

string-functions: fix a subtle bug on [] calls of Table #125

Merged
merged 2 commits into from
Jan 4, 2025

Conversation

stackmystack
Copy link
Contributor

To reproduce it, open rails console, make a t = Table::new("tab"), then try to t[:col]. StringFunctions' [] will be called with the wrong types. No backtrace, no nothing.

If you want a backtrace, you can do pp t[:col]. It turns out that our [] was shadowing Struct's own [] that is defined in C, not in Ruby, and it explaians why it was impossible to get the source_location from the call stack.

To reproduce it, open rails console, make a `t = Table::new("tab")`, then
try to t[:col]. StringFunctions' [] will be called with the wrong types.
No backtrace, no nothing.

If you want a backtrace, you can do `pp t[:col]`. It turns out that our
[] was shadowing Struct's own [] that is defined in C, not in Ruby,
and it explaians why it was impossible to get the `source_location`
from the call stack.
@stackmystack stackmystack merged commit b56d530 into master Jan 4, 2025
187 checks passed
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.

1 participant