diff options
author | Gary Tou <gary@garytou.com> | 2023-04-25 23:22:10 -0400 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2023-04-26 10:21:20 -0400 |
commit | 1883dc5bde27caec44154b7ce1f06b07f95eab3d (patch) | |
tree | 561e364d5013a6a3bce15523bfbac245e933370a /test | |
parent | ffce3117b6b615666cab8f92a7fc32ecefc0121c (diff) | |
download | ruby-1883dc5bde27caec44154b7ce1f06b07f95eab3d.tar.gz |
defined zsuper: Handle NULL superclass for `BasicObject`
Prior to this commit, a segmentation fault occurred in `vm_defined`'s
`zsuper` implementation after NULL is returned as `BasicObject`'s superclass.
This fix returns false from `vm_defined` if the superclass is NULL.
For example, the following code resulted in a segfault.
```ruby
class BasicObject
def seg_fault
defined?(super)
end
end
seg_fault
```
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions