summaryrefslogtreecommitdiffhomepage
path: root/test/t/codegen.rb
diff options
context:
space:
mode:
authorBouke van der Bijl <[email protected]>2016-11-14 17:28:18 -0500
committerBouke van der Bijl <[email protected]>2016-11-24 10:20:42 -0500
commit71641bbf732ab8cbadf8a07e20b2a939b0e3b82b (patch)
tree1b2aa3eb2d4ab2fbab4c11da633fa0657a3afdff /test/t/codegen.rb
parenta630c4f413f6af764e68210430e8b61a435d38d7 (diff)
downloadmruby-71641bbf732ab8cbadf8a07e20b2a939b0e3b82b.tar.gz
mruby-71641bbf732ab8cbadf8a07e20b2a939b0e3b82b.zip
Fix segfault caused by empty condition in ternary
Reported by https://hackerone.com/jpenalbae
Diffstat (limited to 'test/t/codegen.rb')
-rw-r--r--test/t/codegen.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/t/codegen.rb b/test/t/codegen.rb
new file mode 100644
index 000000000..99d6dbe66
--- /dev/null
+++ b/test/t/codegen.rb
@@ -0,0 +1,6 @@
+##
+# Codegen tests
+
+assert('empty condition in ternary expression parses correctly') do
+ assert_equal () ? 1 : 2, 2
+end