summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2016-12-10 15:52:41 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2016-12-10 15:52:41 +0900
commit13979a43768953e8983a73aef45251063aef6485 (patch)
tree34e537ae32481c49558c78e1d4f9b8e31ffad98e /test
parent0af170fbec1bbf412b009117736d22e6f5c39b03 (diff)
parentd56a19cbf526190de036130fe3a5bf14a0705ee2 (diff)
downloadmruby-13979a43768953e8983a73aef45251063aef6485.tar.gz
mruby-13979a43768953e8983a73aef45251063aef6485.zip
Merge pull request #3324 from bouk/mruby/bouk-negate
Don't generate code for NODE_NEGATE if the result isn't used Reported by https://hackerone.com/haquaman
Diffstat (limited to 'test')
-rw-r--r--test/t/codegen.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/t/codegen.rb b/test/t/codegen.rb
index 528f58d9e..709902741 100644
--- a/test/t/codegen.rb
+++ b/test/t/codegen.rb
@@ -81,3 +81,13 @@ assert('next in normal loop with 127 arguments') do
end
end
end
+
+assert('negate literal register alignment') do
+ a = *case
+ when 0
+ -0.0
+ 2
+ end
+
+ assert_equal [2], a
+end