Commit 23c4ad08 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #3319 from bouk/apost-splatt

Fix segfault when using result of rest assignment
parents 79a621dd fe362c1f
...@@ -1061,8 +1061,10 @@ gen_vmassignment(codegen_scope *s, node *tree, int rhs, int val) ...@@ -1061,8 +1061,10 @@ gen_vmassignment(codegen_scope *s, node *tree, int rhs, int val)
n++; n++;
} }
} }
if (!val) {
push(); push();
} }
}
} }
static void static void
......
...@@ -54,3 +54,12 @@ A ...@@ -54,3 +54,12 @@ A
B B
assert_equal "\n", a assert_equal "\n", a
end end
assert('splat in case splat') do
a = *case
when 0
* = 1
end
assert_equal [1], a
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment