mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	compile.c (rb_iseq_compile_node): Move the check for imemo_ifunc to top
Applying nd_type to imemo_ifunc object seems harmless fortunately, but very dirty (to me). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									55f93cb63f
								
							
						
					
					
						commit
						e0bed5f32e
					
				
					 1 changed files with 6 additions and 5 deletions
				
			
		
							
								
								
									
										11
									
								
								compile.c
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								compile.c
									
										
									
									
									
								
							| 
						 | 
					@ -618,6 +618,12 @@ rb_iseq_compile_node(rb_iseq_t *iseq, const NODE *node)
 | 
				
			||||||
	COMPILE(ret, "nil", node);
 | 
						COMPILE(ret, "nil", node);
 | 
				
			||||||
	iseq_set_local_table(iseq, 0);
 | 
						iseq_set_local_table(iseq, 0);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    else if (imemo_type_p((VALUE)node, imemo_ifunc)) {
 | 
				
			||||||
 | 
						const struct vm_ifunc *ifunc = (struct vm_ifunc *)node;
 | 
				
			||||||
 | 
						/* user callback */
 | 
				
			||||||
 | 
						(*ifunc->func)(iseq, ret, ifunc->data);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    /* assume node is T_NODE */
 | 
				
			||||||
    else if (nd_type(node) == NODE_SCOPE) {
 | 
					    else if (nd_type(node) == NODE_SCOPE) {
 | 
				
			||||||
	/* iseq type of top, method, class, block */
 | 
						/* iseq type of top, method, class, block */
 | 
				
			||||||
	iseq_set_local_table(iseq, node->nd_tbl);
 | 
						iseq_set_local_table(iseq, node->nd_tbl);
 | 
				
			||||||
| 
						 | 
					@ -664,11 +670,6 @@ rb_iseq_compile_node(rb_iseq_t *iseq, const NODE *node)
 | 
				
			||||||
	  }
 | 
						  }
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else if (imemo_type_p((VALUE)node, imemo_ifunc)) {
 | 
					 | 
				
			||||||
	const struct vm_ifunc *ifunc = (struct vm_ifunc *)node;
 | 
					 | 
				
			||||||
	/* user callback */
 | 
					 | 
				
			||||||
	(*ifunc->func)(iseq, ret, ifunc->data);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    else {
 | 
					    else {
 | 
				
			||||||
	const char *m;
 | 
						const char *m;
 | 
				
			||||||
#define INVALID_ISEQ_TYPE(type) \
 | 
					#define INVALID_ISEQ_TYPE(type) \
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue