ruby-changes:26910
From: nobu <ko1@a...>
Date: Mon, 28 Jan 2013 18:02:31 +0900 (JST)
Subject: [ruby-changes:26910] nobu:r38962 (trunk): vm_backtrace.c: use long
nobu 2013-01-28 18:02:19 +0900 (Mon, 28 Jan 2013) New Revision: 38962 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38962 Log: vm_backtrace.c: use long * vm_backtrace.c (rb_debug_inspector_frame_{class,binding,iseq}_get): use long as index as well as RARRAY_LEN(). Modified files: trunk/ChangeLog trunk/include/ruby/debug.h trunk/vm_backtrace.c Index: include/ruby/debug.h =================================================================== --- include/ruby/debug.h (revision 38961) +++ include/ruby/debug.h (revision 38962) @@ -31,9 +31,9 @@ typedef struct rb_debug_inspector_struct https://github.com/ruby/ruby/blob/trunk/include/ruby/debug.h#L31 typedef VALUE (*rb_debug_inspector_func_t)(const rb_debug_inspector_t *, void *); VALUE rb_debug_inspector_open(rb_debug_inspector_func_t func, void *data); -VALUE rb_debug_inspector_frame_binding_get(const rb_debug_inspector_t *dc, int index); -VALUE rb_debug_inspector_frame_class_get(const rb_debug_inspector_t *dc, int index); -VALUE rb_debug_inspector_frame_iseq_get(const rb_debug_inspector_t *dc, int index); +VALUE rb_debug_inspector_frame_binding_get(const rb_debug_inspector_t *dc, long index); +VALUE rb_debug_inspector_frame_class_get(const rb_debug_inspector_t *dc, long index); +VALUE rb_debug_inspector_frame_iseq_get(const rb_debug_inspector_t *dc, long index); VALUE rb_debug_inspector_backtrace_locations(const rb_debug_inspector_t *dc); /* Old style set_trace_func APIs */ Index: ChangeLog =================================================================== --- ChangeLog (revision 38961) +++ ChangeLog (revision 38962) @@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Mon Jan 28 18:02:16 2013 Nobuyoshi Nakada <nobu@r...> + + * vm_backtrace.c (rb_debug_inspector_frame_{class,binding,iseq}_get): + use long as index as well as RARRAY_LEN(). + +Mon Jan 28 17:58:44 2013 Nobuyoshi Nakada <nobu@r...> + + * vm_backtrace.c (rb_debug_inspector_frame_{class,binding,iseq}_get): + use long as index as well as RARRAY_LEN(). + Mon Jan 28 17:51:38 2013 Nobuyoshi Nakada <nobu@r...> * test/ruby/envutil.rb (assert_separately): imply no core dump. Index: vm_backtrace.c =================================================================== --- vm_backtrace.c (revision 38961) +++ vm_backtrace.c (revision 38962) @@ -1009,7 +1009,7 @@ struct rb_debug_inspector_struct { https://github.com/ruby/ruby/blob/trunk/vm_backtrace.c#L1009 rb_control_frame_t *cfp; VALUE backtrace; VALUE contexts; /* [[klass, binding, iseq, cfp], ...] */ - int backtrace_size; + long backtrace_size; }; struct collect_caller_bindings_data { @@ -1072,7 +1072,7 @@ rb_debug_inspector_open(rb_debug_inspect https://github.com/ruby/ruby/blob/trunk/vm_backtrace.c#L1072 dbg_context.th = th; dbg_context.cfp = dbg_context.th->cfp; dbg_context.backtrace = vm_backtrace_location_ary(th, 0, 0); - dbg_context.backtrace_size = RARRAY_LENINT(dbg_context.backtrace); + dbg_context.backtrace_size = RARRAY_LEN(dbg_context.backtrace); dbg_context.contexts = collect_caller_bindings(th); TH_PUSH_TAG(th); @@ -1091,7 +1091,7 @@ rb_debug_inspector_open(rb_debug_inspect https://github.com/ruby/ruby/blob/trunk/vm_backtrace.c#L1091 } static VALUE -frame_get(const rb_debug_inspector_t *dc, int index) +frame_get(const rb_debug_inspector_t *dc, long index) { if (index < 0 || index >= dc->backtrace_size) { rb_raise(rb_eArgError, "no such frame"); @@ -1100,21 +1100,21 @@ frame_get(const rb_debug_inspector_t *dc https://github.com/ruby/ruby/blob/trunk/vm_backtrace.c#L1100 } VALUE -rb_debug_inspector_frame_class_get(const rb_debug_inspector_t *dc, int index) +rb_debug_inspector_frame_class_get(const rb_debug_inspector_t *dc, long index) { VALUE frame = frame_get(dc, index); return rb_ary_entry(frame, 0); } VALUE -rb_debug_inspector_frame_binding_get(const rb_debug_inspector_t *dc, int index) +rb_debug_inspector_frame_binding_get(const rb_debug_inspector_t *dc, long index) { VALUE frame = frame_get(dc, index); return rb_ary_entry(frame, 1); } VALUE -rb_debug_inspector_frame_iseq_get(const rb_debug_inspector_t *dc, int index) +rb_debug_inspector_frame_iseq_get(const rb_debug_inspector_t *dc, long index) { VALUE frame = frame_get(dc, index); return rb_ary_entry(frame, 2); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/