Bug #4001

RubyVM::InstructionSequence.compile can not take the 5th argument

Added by Yutaka HARA over 3 years ago. Updated over 1 year ago.

[ruby-core:32953]
Status:Closed
Priority:Normal
Assignee:Koichi Sasada
Category:YARV
Target version:-
ruby -v:1.9.2p0 Backport:

Description

=begin
InstructionSequence.compile takes src, file, path, line, opt
as the arguments, but raises ArgumentError when opt is given.

Example:

$ ruby -e 'p RubyVM::InstructionSequence.compile("", "", "", 1, {})'
-e:1:in `compile': wrong number of arguments (5 for 1..4) (ArgumentError)

Patch:

Index: iseq.c
===================================================================
--- iseq.c (revision 29626)
+++ iseq.c (working copy)
@@ -581,7 +581,7 @@

  rb_secure(1);
  • rbscanargs(argc, argv, "13", &src, &file, &path, &line, &opt);
  • rbscanargs(argc, argv, "14", &src, &file, &path, &line, &opt); if (NILP(file)) file = rbstrnew2(""); if (NILP(line)) line = INT2FIX(1); =end

History

#1 Updated by Koichi Sasada over 3 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r29630.
Yutaka, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Also available in: Atom PDF