diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-03 14:13:36 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-03 14:13:36 +0000 |
commit | c98eea85969b5308a49480e2af68782da637a429 (patch) | |
tree | ae6251c7dccff61d21a4d8408333ec5f70e13fac /vm.c | |
parent | 03a7f0df19f5b3f0253ead3c34ec2e96998a7e5a (diff) | |
download | ruby-c98eea85969b5308a49480e2af68782da637a429.tar.gz ruby-c98eea85969b5308a49480e2af68782da637a429.tar.xz ruby-c98eea85969b5308a49480e2af68782da637a429.zip |
* vm.c (vm_backtrace): always returns non-nil array if lev is
negative. [ruby-core:21795]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -737,6 +737,9 @@ vm_backtrace(rb_thread_t *th, int lev) { VALUE ary = 0; + if (lev < 0) { + ary = rb_ary_new(); + } vm_backtrace_each(th, lev, vm_backtrace_push, &ary); if (!ary) return Qnil; return rb_ary_reverse(ary); |