diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-02 00:49:40 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-02 00:49:40 +0000 |
commit | a2d8643e9313590e339933d296ff13d8d85f6b45 (patch) | |
tree | ad59528589f2321f3a318400f732dc80a88c5ce8 | |
parent | 7b5c9eb0419c2336b353b3532fc4555375b02920 (diff) | |
download | ruby-a2d8643e9313590e339933d296ff13d8d85f6b45.tar.gz |
* vm.c (vm_backtrace_each): progname is not available at
initializing phase.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | vm.c | 4 |
2 files changed, 7 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Mon Feb 2 09:49:39 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * vm.c (vm_backtrace_each): progname is not available at + initializing phase. + Mon Feb 2 08:12:50 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> * lib/xmlrpc/server.rb (Server#serve): gets rid of hardcoded @@ -692,7 +692,7 @@ vm_backtrace_each(rb_thread_t *th, int lev, rb_backtrace_iter_func *iter, void * { const rb_control_frame_t *limit_cfp = th->cfp; const rb_control_frame_t *cfp = (void *)(th->stack + th->stack_size); - const char *file; + const char *file = "ruby"; int line_no = 0; cfp -= 2; @@ -702,7 +702,7 @@ vm_backtrace_each(rb_thread_t *th, int lev, rb_backtrace_iter_func *iter, void * } } limit_cfp = RUBY_VM_NEXT_CONTROL_FRAME(limit_cfp); - file = RSTRING_PTR(th->vm->progname); + if (th->vm->progname) file = RSTRING_PTR(th->vm->progname); while (cfp > limit_cfp) { if (cfp->iseq != 0) { if (cfp->pc != 0) { |