Skip to content

ResumableParser: use throw rather than raise for handled EOS#1031

Merged
byroot merged 2 commits into
ruby:masterfrom
byroot:resumable-eos-throw
Jun 19, 2026
Merged

ResumableParser: use throw rather than raise for handled EOS#1031
byroot merged 2 commits into
ruby:masterfrom
byroot:resumable-eos-throw

Conversation

@byroot

@byroot byroot commented Jun 19, 2026

Copy link
Copy Markdown
Member

Since the exception will be swallowed, building a message and backtrace is just a waste of time.

Since the exception will be swallowed, building a message and
backtrace is just a waste of time.
Comment thread ext/json/ext/parser/parser.c Outdated
static VALUE json_parse_any_resumable_safe(VALUE _args)
{
struct json_parse_any_args *args = (struct json_parse_any_args *)_args;
VALUE result = rb_catch_obj(args->parser, json_parse_any_resumable_safe0, _args);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It looks like on TruffleRuby, rb_catch_obj doesn't call json_parse_any_resumable_safe0 at all. Unclear why...

@byroot byroot force-pushed the resumable-eos-throw branch from 5795ffe to 9c6d5b1 Compare June 19, 2026 11:28
Somehow on TruffleRuby `rb_catch_obj` straight out doesn't call
the passed function, acting as a noop.
@byroot byroot force-pushed the resumable-eos-throw branch from 9c6d5b1 to 3a68749 Compare June 19, 2026 11:29
@byroot byroot merged commit 9d8efcb into ruby:master Jun 19, 2026
42 checks passed
@byroot byroot deleted the resumable-eos-throw branch June 19, 2026 11:36
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