mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	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().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
			
			
This commit is contained in:
		
							parent
							
								
									43ce5ce1b4
								
							
						
					
					
						commit
						616f2c43c6
					
				
					 3 changed files with 19 additions and 9 deletions
				
			
		
							
								
								
									
										10
									
								
								ChangeLog
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								ChangeLog
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,3 +1,13 @@
 | 
			
		|||
Mon Jan 28 18:02:16 2013  Nobuyoshi Nakada  <nobu@ruby-lang.org>
 | 
			
		||||
 | 
			
		||||
	* 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@ruby-lang.org>
 | 
			
		||||
 | 
			
		||||
	* 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@ruby-lang.org>
 | 
			
		||||
 | 
			
		||||
	* test/ruby/envutil.rb (assert_separately): imply no core dump.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -31,9 +31,9 @@ typedef struct rb_debug_inspector_struct rb_debug_inspector_t;
 | 
			
		|||
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 */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1009,7 +1009,7 @@ struct rb_debug_inspector_struct {
 | 
			
		|||
    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_inspector_func_t func, void *data)
 | 
			
		|||
    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_inspector_func_t func, void *data)
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
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, int index)
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue