summaryrefslogtreecommitdiffstats
path: root/vm.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-03 14:13:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-03 14:13:36 +0000
commitc98eea85969b5308a49480e2af68782da637a429 (patch)
treeae6251c7dccff61d21a4d8408333ec5f70e13fac /vm.c
parent03a7f0df19f5b3f0253ead3c34ec2e96998a7e5a (diff)
downloadruby-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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/vm.c b/vm.c
index e73ba39d6..a49926bef 100644
--- a/vm.c
+++ b/vm.c
@@ -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);