summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorChristopher Aue <[email protected]>2017-08-22 14:42:59 +0200
committerChristopher Aue <[email protected]>2017-08-23 18:12:35 +0200
commitc6596cf26a125e9759e01425bea8782ff58dbf4f (patch)
treee544d7531c3b7612b6a5ccdc3d7aada5983faa49 /test
parent64e5208404d37326c071506d861b8bd9776218df (diff)
downloadmruby-c6596cf26a125e9759e01425bea8782ff58dbf4f.tar.gz
mruby-c6596cf26a125e9759e01425bea8782ff58dbf4f.zip
Fixed register windows of OP_SENDs generated by NODE_{SCALL,CASE,YIELD,UNDEF}; ref #3783
Diffstat (limited to 'test')
-rw-r--r--test/t/codegen.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/t/codegen.rb b/test/t/codegen.rb
index 29f5ad525..e3f44de38 100644
--- a/test/t/codegen.rb
+++ b/test/t/codegen.rb
@@ -73,3 +73,39 @@ assert('negate literal register alignment') do
assert_equal [2], a
end
+
+assert('register window of calls (#3783)') do
+ # NODE_SCALL
+ assert_nothing_raised do
+ Object.new&.__id__
+ end
+
+ # NODE_CASE
+ assert_nothing_raised do
+ case 1
+ when nil
+ end
+ end
+
+ # NODE_CASE with splat
+ assert_nothing_raised do
+ case 1
+ when *nil
+ end
+ end
+
+ # NODE_YIELD
+ def check_node_yield
+ yield
+ end
+ assert_nothing_raised do
+ check_node_yield{}
+ end
+
+ # NODE_UNDEF
+ assert_nothing_raised do
+ class << Object.new
+ undef send
+ end
+ end
+end \ No newline at end of file