mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* vm_insnhelper.c (vm_call_method): fix undefined behavior.
Should not access scope local variable from outer scope. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									c6557c6fab
								
							
						
					
					
						commit
						ff2ca81bb3
					
				
					 2 changed files with 8 additions and 2 deletions
				
			
		|  | @ -1,3 +1,8 @@ | ||||||
|  | Wed Nov 28 22:54:21 2012  Koichi Sasada  <ko1@atdot.net> | ||||||
|  | 
 | ||||||
|  | 	* vm_insnhelper.c (vm_call_method): fix undefined behavior. | ||||||
|  | 	  Should not access scope local variable from outer scope. | ||||||
|  | 
 | ||||||
| Wed Nov 28 22:20:55 2012  Masaya Tarui  <tarui@ruby-lang.org> | Wed Nov 28 22:20:55 2012  Masaya Tarui  <tarui@ruby-lang.org> | ||||||
| 
 | 
 | ||||||
| 	* test/ruby/test_thread.rb (test_thread_status_in_trap): change test for | 	* test/ruby/test_thread.rb (test_thread_status_in_trap): change test for | ||||||
|  |  | ||||||
|  | @ -1698,6 +1698,7 @@ static inline VALUE | ||||||
| vm_call_method(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci) | vm_call_method(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci) | ||||||
| { | { | ||||||
|     int enable_fastpath = 1; |     int enable_fastpath = 1; | ||||||
|  |     rb_call_info_t ci_temp; | ||||||
| 
 | 
 | ||||||
|   start_method_dispatch: |   start_method_dispatch: | ||||||
|     if (ci->me != 0) { |     if (ci->me != 0) { | ||||||
|  | @ -1735,8 +1736,8 @@ vm_call_method(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci) | ||||||
| 	      } | 	      } | ||||||
| 	      case VM_METHOD_TYPE_ZSUPER:{ | 	      case VM_METHOD_TYPE_ZSUPER:{ | ||||||
| 		VALUE klass = RCLASS_SUPER(ci->me->klass); | 		VALUE klass = RCLASS_SUPER(ci->me->klass); | ||||||
| 		rb_call_info_t cie = *ci; | 		ci_temp = *ci; | ||||||
| 		ci = &cie; | 		ci = &ci_temp; | ||||||
| 
 | 
 | ||||||
| 		ci->me = rb_method_entry(klass, ci->mid, &ci->defined_class); | 		ci->me = rb_method_entry(klass, ci->mid, &ci->defined_class); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 ko1
						ko1