topazproject / topaz

A high performance ruby, written in RPython
topazruby.com
BSD 3-Clause "New" or "Revised" License
1k stars 84 forks source link

Guard `defined?` from segfault with default value #854

Closed kachick closed 8 years ago

kachick commented 8 years ago

defined? with some code segfaults.

topaz (ruby-1.9.3p125) (git rev 6937882) [x86_64-darwin]

☻  bin/topaz -e 'p defined?(next)'
[1]    69483 segmentation fault  bin/topaz -e 'p defined?(next)'

And below. (noticed from https://github.com/topazproject/topaz/pull/845)

defined?(while x do y end)
defined?(until x do y end)
defined?(break)
defined?(next)
defined?(return)
defined?(__FILE__)