Don't generate code for NODE_NEGATE if the result isn't used

Reported by https://hackerone.com/haquaman
This commit is contained in:
Bouke van der Bijl
2016-12-02 09:48:28 -05:00
parent 5930a6ebc7
commit d56a19cbf5
2 changed files with 14 additions and 0 deletions
+10
View File
@@ -63,3 +63,13 @@ assert('splat in case splat') do
assert_equal [1], a
end
assert('negate literal register alignment') do
a = *case
when 0
-0.0
2
end
assert_equal [2], a
end