Skip to content

Commit

Permalink
Remove the behavior that rb_funcall() passes the rb_iterate() block
Browse files Browse the repository at this point in the history
* From MRI docs: rb_iterate() is obsolete since 1.9; use rb_block_call instead.
  • Loading branch information
eregon committed Jun 9, 2021
1 parent 746ef16 commit e7ddba7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Performance:

Changes:

* `rb_iterate()` (deprecated since 1.9) no longer magically passes the block to `rb_funcall()`, use `rb_block_call()` instead.

Security:

Expand Down
2 changes: 1 addition & 1 deletion lib/truffle/truffle/cext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ def rb_funcallv(recv, meth, args)
end

def rb_funcall(recv, meth, n, *args)
Primitive.send_without_cext_lock(recv, meth, args, rb_block_proc)
Primitive.send_without_cext_lock(recv, meth, args, nil)
end

def rb_apply(recv, meth, args)
Expand Down
1 change: 1 addition & 0 deletions spec/tags/optional/capi/array_tags.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fails(deprecated):C-API Array function rb_iterate calls a function with the other function available as a block
1 change: 0 additions & 1 deletion spec/tags/optional/capi/proc_tags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ fails:C-API when calling Proc.new from a C function returns the Proc passed by t
fails:C-API when calling Proc.new from a C function returns the Proc passed to the Ruby method when the C function calls other Ruby methods before calling Proc.new
fails:C-API when calling Proc.new from a C function returns the most recent Proc passed when the Ruby method called the C function
fails:C-API when calling Proc.new from a C function returns the Proc passed from the original Ruby call to the C function
fails:C-API when calling Proc.new from a C function raises an ArgumentError when the C function calls a Ruby method that calls Proc.new

0 comments on commit e7ddba7

Please sign in to comment.