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

[Bug #17192] raise when loading builtin function #3622

Merged
merged 2 commits into from Nov 30, 2020

Conversation

nobu
Copy link
Member

@nobu nobu commented Oct 2, 2020

No description provided.

@nobu nobu force-pushed the bug/17192-loading-builtin-function branch 2 times, most recently from 63a6bcf to dc1ff63 Compare October 3, 2020 03:27
nevans pushed a commit to nevans/ruby that referenced this pull request Nov 14, 2020
f.write(RubyVM::InstructionSequence.of(1.method(:abs)).to_binary)
f.close
assert_normal_exit("#{<<~"begin;"}\n#{<<~'end;'}")
path = ""#{f.path.dump}
Copy link
Contributor

Choose a reason for hiding this comment

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

The ""#{f.path.dump} part seems odd to me. It also seems odd this checks for a normal exit, when the use of a builtin function inside an iseq should raise an ArgumentError when loading. Maybe we want something like this:

+      assert_raise(ArgumentError) do
+        RubyVM::InstructionSequence.load_from_binary(File.binread(f.path))
+      end

Of if we do want to use a separate process, check that it produces an error instead of exits normally?

The compile.c changes do look correct and I tested that the patch does fix the crash.

Copy link
Member Author

Choose a reason for hiding this comment

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

""#{f.path.dump} is to tell ruby-mode.el that the rest is not in the string literal.

@nobu nobu force-pushed the bug/17192-loading-builtin-function branch from dc1ff63 to a74b2a3 Compare November 25, 2020 12:25
@nobu nobu merged commit 555bd83 into ruby:master Nov 30, 2020
@nobu nobu deleted the bug/17192-loading-builtin-function branch November 30, 2020 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants