summaryrefslogtreecommitdiff
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
commitbca5029d8b4e27a8bfb9fa9c42617adeaa23b7d7 (patch)
treeae6251c7dccff61d21a4d8408333ec5f70e13fac /vm.c
parente2fc3f38afe79b32c698d7fb05a2fed26af81c4d (diff)
* vm.c (vm_backtrace): always returns non-nil array if lev is
negative. [ruby-core:21795] git-svn-id: svn+ssh://ci.ruby-lang.org/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 e73ba39d6a..a49926bef1 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);