Fix segfault when using result of rest assignment

Reported by https://hackerone.com/haquaman
parent 2cca9d36
...@@ -1061,7 +1061,9 @@ gen_vmassignment(codegen_scope *s, node *tree, int rhs, int val) ...@@ -1061,7 +1061,9 @@ gen_vmassignment(codegen_scope *s, node *tree, int rhs, int val)
n++; n++;
} }
} }
push(); if (!val) {
push();
}
} }
} }
......
...@@ -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