mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	Using NIL_P macro instead of == Qnil
				
					
				
			This commit is contained in:
		
							parent
							
								
									fb03598666
								
							
						
					
					
						commit
						dc9112cf10
					
				
				
				Notes:
				
					git
				
				2021-10-03 22:35:06 +09:00 
				
			
			Merged: https://github.com/ruby/ruby/pull/4925 Merged-By: nobu <nobu@ruby-lang.org>
					 18 changed files with 43 additions and 43 deletions
				
			
		
							
								
								
									
										6
									
								
								array.c
									
										
									
									
									
								
							
							
						
						
									
										6
									
								
								array.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -3466,7 +3466,7 @@ rb_ary_bsearch_index(VALUE ary)
 | 
			
		|||
	    satisfied = 1;
 | 
			
		||||
	    smaller = 1;
 | 
			
		||||
	}
 | 
			
		||||
	else if (v == Qfalse || v == Qnil) {
 | 
			
		||||
	else if (!RTEST(v)) {
 | 
			
		||||
	    smaller = 0;
 | 
			
		||||
	}
 | 
			
		||||
	else if (rb_obj_is_kind_of(v, rb_cNumeric)) {
 | 
			
		||||
| 
						 | 
				
			
			@ -6479,7 +6479,7 @@ rb_ary_cycle_size(VALUE self, VALUE args, VALUE eobj)
 | 
			
		|||
	n = RARRAY_AREF(args, 0);
 | 
			
		||||
    }
 | 
			
		||||
    if (RARRAY_LEN(self) == 0) return INT2FIX(0);
 | 
			
		||||
    if (n == Qnil) return DBL2NUM(HUGE_VAL);
 | 
			
		||||
    if (NIL_P(n)) return DBL2NUM(HUGE_VAL);
 | 
			
		||||
    mul = NUM2LONG(n);
 | 
			
		||||
    if (mul <= 0) return INT2FIX(0);
 | 
			
		||||
    n = LONG2FIX(mul);
 | 
			
		||||
| 
						 | 
				
			
			@ -7344,7 +7344,7 @@ rb_ary_drop(VALUE ary, VALUE n)
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    result = rb_ary_subseq(ary, pos, RARRAY_LEN(ary));
 | 
			
		||||
    if (result == Qnil) result = rb_ary_new();
 | 
			
		||||
    if (NIL_P(result)) result = rb_ary_new();
 | 
			
		||||
    return result;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9934,7 +9934,7 @@ iseq_build_from_ary_exception(rb_iseq_t *iseq, struct st_table *labels_table,
 | 
			
		|||
	    rb_raise(rb_eSyntaxError, "wrong exception entry");
 | 
			
		||||
	}
 | 
			
		||||
        type = get_exception_sym2type(RARRAY_AREF(v, 0));
 | 
			
		||||
        if (RARRAY_AREF(v, 1) == Qnil) {
 | 
			
		||||
        if (NIL_P(RARRAY_AREF(v, 1))) {
 | 
			
		||||
	    eiseq = NULL;
 | 
			
		||||
	}
 | 
			
		||||
	else {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								dir.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								dir.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -989,7 +989,7 @@ chdir_yield(VALUE v)
 | 
			
		|||
    dir_chdir(args->new_path);
 | 
			
		||||
    args->done = TRUE;
 | 
			
		||||
    chdir_blocking++;
 | 
			
		||||
    if (chdir_thread == Qnil)
 | 
			
		||||
    if (NIL_P(chdir_thread))
 | 
			
		||||
	chdir_thread = rb_thread_current();
 | 
			
		||||
    return rb_yield(args->new_path);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										4
									
								
								enum.c
									
										
									
									
									
								
							
							
						
						
									
										4
									
								
								enum.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -2921,7 +2921,7 @@ enum_each_slice_size(VALUE obj, VALUE args, VALUE eobj)
 | 
			
		|||
    if (slice_size <= 0) rb_raise(rb_eArgError, "invalid slice size");
 | 
			
		||||
 | 
			
		||||
    size = enum_size(obj, 0, 0);
 | 
			
		||||
    if (size == Qnil) return Qnil;
 | 
			
		||||
    if (NIL_P(size)) return Qnil;
 | 
			
		||||
    if (RB_FLOAT_TYPE_P(size) && RTEST(rb_funcall(size, infinite_p, 0))) {
 | 
			
		||||
        return size;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -3003,7 +3003,7 @@ enum_each_cons_size(VALUE obj, VALUE args, VALUE eobj)
 | 
			
		|||
    if (cons_size <= 0) rb_raise(rb_eArgError, "invalid size");
 | 
			
		||||
 | 
			
		||||
    size = enum_size(obj, 0, 0);
 | 
			
		||||
    if (size == Qnil) return Qnil;
 | 
			
		||||
    if (NIL_P(size)) return Qnil;
 | 
			
		||||
 | 
			
		||||
    n = add_int(size, 1 - cons_size);
 | 
			
		||||
    return (OPTIMIZED_CMP(n, zero, cmp_opt) == -1) ? zero : n;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								error.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								error.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1986,7 +1986,7 @@ name_err_mesg_to_str(VALUE obj)
 | 
			
		|||
	    break;
 | 
			
		||||
	  default:
 | 
			
		||||
	    d = rb_protect(name_err_mesg_receiver_name, obj, &state);
 | 
			
		||||
	    if (state || d == Qundef || d == Qnil)
 | 
			
		||||
	    if (state || d == Qundef || NIL_P(d))
 | 
			
		||||
		d = rb_protect(rb_inspect, obj, &state);
 | 
			
		||||
	    if (state) {
 | 
			
		||||
		rb_set_errinfo(Qnil);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										8
									
								
								gc.c
									
										
									
									
									
								
							
							
						
						
									
										8
									
								
								gc.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -4354,7 +4354,7 @@ id2ref(VALUE objid)
 | 
			
		|||
        ptr = NUM2PTR(objid);
 | 
			
		||||
        if (ptr == Qtrue) return Qtrue;
 | 
			
		||||
        if (ptr == Qfalse) return Qfalse;
 | 
			
		||||
        if (ptr == Qnil) return Qnil;
 | 
			
		||||
        if (NIL_P(ptr)) return Qnil;
 | 
			
		||||
        if (FIXNUM_P(ptr)) return (VALUE)ptr;
 | 
			
		||||
        if (FLONUM_P(ptr)) return (VALUE)ptr;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -4802,7 +4802,7 @@ count_objects(int argc, VALUE *argv, VALUE os)
 | 
			
		|||
	total += page->total_slots;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (hash == Qnil) {
 | 
			
		||||
    if (NIL_P(hash)) {
 | 
			
		||||
        hash = rb_hash_new();
 | 
			
		||||
    }
 | 
			
		||||
    else if (!RHASH_EMPTY_P(hash)) {
 | 
			
		||||
| 
						 | 
				
			
			@ -8784,7 +8784,7 @@ rb_gc_register_mark_object(VALUE obj)
 | 
			
		|||
        VALUE ary_ary = GET_VM()->mark_object_ary;
 | 
			
		||||
        VALUE ary = rb_ary_last(0, 0, ary_ary);
 | 
			
		||||
 | 
			
		||||
        if (ary == Qnil || RARRAY_LEN(ary) >= MARK_OBJECT_ARY_BUCKET_SIZE) {
 | 
			
		||||
        if (NIL_P(ary) || RARRAY_LEN(ary) >= MARK_OBJECT_ARY_BUCKET_SIZE) {
 | 
			
		||||
            ary = rb_ary_tmp_new(MARK_OBJECT_ARY_BUCKET_SIZE);
 | 
			
		||||
            rb_ary_push(ary_ary, ary);
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -10383,7 +10383,7 @@ gc_info_decode(rb_objspace_t *objspace, const VALUE hash_or_key, const unsigned
 | 
			
		|||
        rb_raise(rb_eTypeError, "non-hash or symbol given");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (sym_major_by == Qnil) {
 | 
			
		||||
    if (NIL_P(sym_major_by)) {
 | 
			
		||||
#define S(s) sym_##s = ID2SYM(rb_intern_const(#s))
 | 
			
		||||
        S(major_by);
 | 
			
		||||
        S(gc_by);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								io.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								io.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -10634,7 +10634,7 @@ rb_io_s_pipe(int argc, VALUE *argv, VALUE klass)
 | 
			
		|||
 | 
			
		||||
    extract_binmode(opt, &fmode);
 | 
			
		||||
 | 
			
		||||
    if ((fmode & FMODE_BINMODE) && v1 == Qnil) {
 | 
			
		||||
    if ((fmode & FMODE_BINMODE) && NIL_P(v1)) {
 | 
			
		||||
        rb_io_ascii8bit_binmode(r);
 | 
			
		||||
        rb_io_ascii8bit_binmode(w);
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										8
									
								
								iseq.c
									
										
									
									
									
								
							
							
						
						
									
										8
									
								
								iseq.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -503,7 +503,7 @@ rb_iseq_pathobj_new(VALUE path, VALUE realpath)
 | 
			
		|||
{
 | 
			
		||||
    VALUE pathobj;
 | 
			
		||||
    VM_ASSERT(RB_TYPE_P(path, T_STRING));
 | 
			
		||||
    VM_ASSERT(realpath == Qnil || RB_TYPE_P(realpath, T_STRING));
 | 
			
		||||
    VM_ASSERT(NIL_P(realpath) || RB_TYPE_P(realpath, T_STRING));
 | 
			
		||||
 | 
			
		||||
    if (path == realpath ||
 | 
			
		||||
	(!NIL_P(realpath) && rb_str_cmp(path, realpath) == 0)) {
 | 
			
		||||
| 
						 | 
				
			
			@ -759,7 +759,7 @@ rb_iseq_make_compile_option(rb_compile_option_t *option, VALUE opt)
 | 
			
		|||
static void
 | 
			
		||||
make_compile_option(rb_compile_option_t *option, VALUE opt)
 | 
			
		||||
{
 | 
			
		||||
    if (opt == Qnil) {
 | 
			
		||||
    if (NIL_P(opt)) {
 | 
			
		||||
	*option = COMPILE_OPTION_DEFAULT;
 | 
			
		||||
    }
 | 
			
		||||
    else if (opt == Qfalse) {
 | 
			
		||||
| 
						 | 
				
			
			@ -2413,7 +2413,7 @@ iseq_iterate_children(const rb_iseq_t *iseq, void (*iter_func)(const rb_iseq_t *
 | 
			
		|||
                UNALIGNED_MEMBER_PTR(body->catch_table, entries[i]);
 | 
			
		||||
            child = entry->iseq;
 | 
			
		||||
            if (child) {
 | 
			
		||||
                if (rb_hash_aref(all_children, (VALUE)child) == Qnil) {
 | 
			
		||||
                if (NIL_P(rb_hash_aref(all_children, (VALUE)child))) {
 | 
			
		||||
                    rb_hash_aset(all_children, (VALUE)child, Qtrue);
 | 
			
		||||
                    (*iter_func)(child, data);
 | 
			
		||||
                }
 | 
			
		||||
| 
						 | 
				
			
			@ -2432,7 +2432,7 @@ iseq_iterate_children(const rb_iseq_t *iseq, void (*iter_func)(const rb_iseq_t *
 | 
			
		|||
              case TS_ISEQ:
 | 
			
		||||
                child = (const rb_iseq_t *)code[i+j+1];
 | 
			
		||||
                if (child) {
 | 
			
		||||
                    if (rb_hash_aref(all_children, (VALUE)child) == Qnil) {
 | 
			
		||||
                    if (NIL_P(rb_hash_aref(all_children, (VALUE)child))) {
 | 
			
		||||
                        rb_hash_aset(all_children, (VALUE)child, Qtrue);
 | 
			
		||||
                        (*iter_func)(child, data);
 | 
			
		||||
                    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -777,7 +777,7 @@ w_object(VALUE obj, struct dump_arg *arg, int limit)
 | 
			
		|||
	return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (obj == Qnil) {
 | 
			
		||||
    if (NIL_P(obj)) {
 | 
			
		||||
	w_byte(TYPE_NIL, arg);
 | 
			
		||||
    }
 | 
			
		||||
    else if (obj == Qtrue) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										4
									
								
								range.c
									
										
									
									
									
								
							
							
						
						
									
										4
									
								
								range.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -642,7 +642,7 @@ bsearch_integer_range(VALUE beg, VALUE end, int excl)
 | 
			
		|||
	    satisfied = val; \
 | 
			
		||||
	    smaller = 1; \
 | 
			
		||||
	} \
 | 
			
		||||
	else if (v == Qfalse || v == Qnil) { \
 | 
			
		||||
	else if (!RTEST(v)) { \
 | 
			
		||||
	    smaller = 0; \
 | 
			
		||||
	} \
 | 
			
		||||
	else if (rb_obj_is_kind_of(v, rb_cNumeric)) { \
 | 
			
		||||
| 
						 | 
				
			
			@ -1952,7 +1952,7 @@ r_cover_range_p(VALUE range, VALUE beg, VALUE end, VALUE val)
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    val_max = rb_rescue2(r_call_max, val, 0, Qnil, rb_eTypeError, (VALUE)0);
 | 
			
		||||
    if (val_max == Qnil) return FALSE;
 | 
			
		||||
    if (NIL_P(val_max)) return FALSE;
 | 
			
		||||
 | 
			
		||||
    return r_less(end, val_max) >= 0;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										10
									
								
								re.c
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								re.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1557,7 +1557,7 @@ rb_reg_prepare_re0(VALUE re, VALUE str, onig_errmsg_buffer err)
 | 
			
		|||
	pattern, pattern + RREGEXP_SRC_LEN(re), enc,
 | 
			
		||||
	&fixed_enc, err);
 | 
			
		||||
 | 
			
		||||
    if (unescaped == Qnil) {
 | 
			
		||||
    if (NIL_P(unescaped)) {
 | 
			
		||||
	rb_raise(rb_eArgError, "regexp preprocess failed: %s", err);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -2357,7 +2357,7 @@ match_inspect(VALUE match)
 | 
			
		|||
            rb_str_buf_cat2(str, ":");
 | 
			
		||||
        }
 | 
			
		||||
        v = rb_reg_nth_match(i, match);
 | 
			
		||||
        if (v == Qnil)
 | 
			
		||||
        if (NIL_P(v))
 | 
			
		||||
            rb_str_buf_cat2(str, "nil");
 | 
			
		||||
        else
 | 
			
		||||
            rb_str_buf_append(str, rb_str_inspect(v));
 | 
			
		||||
| 
						 | 
				
			
			@ -2800,7 +2800,7 @@ rb_reg_check_preprocess(VALUE str)
 | 
			
		|||
    buf = rb_reg_preprocess(p, end, enc, &fixed_enc, err);
 | 
			
		||||
    RB_GC_GUARD(str);
 | 
			
		||||
 | 
			
		||||
    if (buf == Qnil) {
 | 
			
		||||
    if (NIL_P(buf)) {
 | 
			
		||||
	return rb_reg_error_desc(str, 0, err);
 | 
			
		||||
    }
 | 
			
		||||
    return Qnil;
 | 
			
		||||
| 
						 | 
				
			
			@ -2841,7 +2841,7 @@ rb_reg_preprocess_dregexp(VALUE ary, int options)
 | 
			
		|||
 | 
			
		||||
        buf = rb_reg_preprocess(p, end, src_enc, &fixed_enc, err);
 | 
			
		||||
 | 
			
		||||
        if (buf == Qnil)
 | 
			
		||||
        if (NIL_P(buf))
 | 
			
		||||
            rb_raise(rb_eArgError, "%s", err);
 | 
			
		||||
 | 
			
		||||
        if (fixed_enc != 0) {
 | 
			
		||||
| 
						 | 
				
			
			@ -2887,7 +2887,7 @@ rb_reg_initialize(VALUE obj, const char *s, long len, rb_encoding *enc,
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    unescaped = rb_reg_preprocess(s, s+len, enc, &fixed_enc, err);
 | 
			
		||||
    if (unescaped == Qnil)
 | 
			
		||||
    if (NIL_P(unescaped))
 | 
			
		||||
        return -1;
 | 
			
		||||
 | 
			
		||||
    if (fixed_enc) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										4
									
								
								struct.c
									
										
									
									
									
								
							
							
						
						
									
										4
									
								
								struct.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -712,7 +712,7 @@ struct_hash_set_i(VALUE key, VALUE val, VALUE arg)
 | 
			
		|||
    struct struct_hash_set_arg *args = (struct struct_hash_set_arg *)arg;
 | 
			
		||||
    int i = rb_struct_pos(args->self, &key);
 | 
			
		||||
    if (i < 0) {
 | 
			
		||||
	if (args->unknown_keywords == Qnil) {
 | 
			
		||||
	if (NIL_P(args->unknown_keywords)) {
 | 
			
		||||
	    args->unknown_keywords = rb_ary_new();
 | 
			
		||||
	}
 | 
			
		||||
	rb_ary_push(args->unknown_keywords, key);
 | 
			
		||||
| 
						 | 
				
			
			@ -754,7 +754,7 @@ rb_struct_initialize_m(int argc, const VALUE *argv, VALUE self)
 | 
			
		|||
	if (n < argc) {
 | 
			
		||||
	    rb_raise(rb_eArgError, "struct size differs");
 | 
			
		||||
	}
 | 
			
		||||
        if (keyword_init == Qnil && argc == 1 && RB_TYPE_P(argv[0], T_HASH) && rb_keyword_given_p()) {
 | 
			
		||||
        if (NIL_P(keyword_init) && argc == 1 && RB_TYPE_P(argv[0], T_HASH) && rb_keyword_given_p()) {
 | 
			
		||||
            rb_warn("Passing only keyword arguments to Struct#initialize will behave differently from Ruby 3.2. "\
 | 
			
		||||
                    "Please use a Hash literal like .new({k: v}) instead of .new(k: v).");
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								thread.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								thread.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1330,7 +1330,7 @@ thread_join_m(int argc, VALUE *argv, VALUE self)
 | 
			
		|||
     * This supports INFINITY and negative values, so we can't use
 | 
			
		||||
     * rb_time_interval right now...
 | 
			
		||||
     */
 | 
			
		||||
    if (timeout == Qnil) {
 | 
			
		||||
    if (NIL_P(timeout)) {
 | 
			
		||||
        /* unlimited */
 | 
			
		||||
    }
 | 
			
		||||
    else if (FIXNUM_P(timeout)) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2102,7 +2102,7 @@ make_econv_exception(rb_econv_t *ec)
 | 
			
		|||
                dumped = rb_sprintf("U+%04X", cc);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        if (dumped == Qnil)
 | 
			
		||||
        if (NIL_P(dumped))
 | 
			
		||||
            dumped = rb_str_dump(bytes);
 | 
			
		||||
        if (strcmp(ec->last_error.source_encoding,
 | 
			
		||||
                   ec->source_encoding_name) == 0 &&
 | 
			
		||||
| 
						 | 
				
			
			@ -3121,7 +3121,7 @@ search_convpath_i(const char *sname, const char *dname, int depth, void *arg)
 | 
			
		|||
    VALUE *ary_p = arg;
 | 
			
		||||
    VALUE v;
 | 
			
		||||
 | 
			
		||||
    if (*ary_p == Qnil) {
 | 
			
		||||
    if (NIL_P(*ary_p)) {
 | 
			
		||||
        *ary_p = rb_ary_new();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										14
									
								
								vm.c
									
										
									
									
									
								
							
							
						
						
									
										14
									
								
								vm.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -3819,11 +3819,11 @@ vm_analysis_insn(int insn)
 | 
			
		|||
    CONST_ID(usage_hash, "USAGE_ANALYSIS_INSN");
 | 
			
		||||
    CONST_ID(bigram_hash, "USAGE_ANALYSIS_INSN_BIGRAM");
 | 
			
		||||
    uh = rb_const_get(rb_cRubyVM, usage_hash);
 | 
			
		||||
    if ((ihash = rb_hash_aref(uh, INT2FIX(insn))) == Qnil) {
 | 
			
		||||
    if (NIL_P(ihash = rb_hash_aref(uh, INT2FIX(insn)))) {
 | 
			
		||||
	ihash = rb_hash_new();
 | 
			
		||||
	HASH_ASET(uh, INT2FIX(insn), ihash);
 | 
			
		||||
    }
 | 
			
		||||
    if ((cv = rb_hash_aref(ihash, INT2FIX(-1))) == Qnil) {
 | 
			
		||||
    if (NIL_P(cv = rb_hash_aref(ihash, INT2FIX(-1)))) {
 | 
			
		||||
	cv = INT2FIX(0);
 | 
			
		||||
    }
 | 
			
		||||
    HASH_ASET(ihash, INT2FIX(-1), INT2FIX(FIX2INT(cv) + 1));
 | 
			
		||||
| 
						 | 
				
			
			@ -3839,7 +3839,7 @@ vm_analysis_insn(int insn)
 | 
			
		|||
	bi = rb_ary_new4(2, &ary[0]);
 | 
			
		||||
 | 
			
		||||
	uh = rb_const_get(rb_cRubyVM, bigram_hash);
 | 
			
		||||
	if ((cv = rb_hash_aref(uh, bi)) == Qnil) {
 | 
			
		||||
	if (NIL_P(cv = rb_hash_aref(uh, bi))) {
 | 
			
		||||
	    cv = INT2FIX(0);
 | 
			
		||||
	}
 | 
			
		||||
	HASH_ASET(uh, bi, INT2FIX(FIX2INT(cv) + 1));
 | 
			
		||||
| 
						 | 
				
			
			@ -3861,11 +3861,11 @@ vm_analysis_operand(int insn, int n, VALUE op)
 | 
			
		|||
    CONST_ID(usage_hash, "USAGE_ANALYSIS_INSN");
 | 
			
		||||
 | 
			
		||||
    uh = rb_const_get(rb_cRubyVM, usage_hash);
 | 
			
		||||
    if ((ihash = rb_hash_aref(uh, INT2FIX(insn))) == Qnil) {
 | 
			
		||||
    if (NIL_P(ihash = rb_hash_aref(uh, INT2FIX(insn)))) {
 | 
			
		||||
	ihash = rb_hash_new();
 | 
			
		||||
	HASH_ASET(uh, INT2FIX(insn), ihash);
 | 
			
		||||
    }
 | 
			
		||||
    if ((ophash = rb_hash_aref(ihash, INT2FIX(n))) == Qnil) {
 | 
			
		||||
    if (NIL_P(ophash = rb_hash_aref(ihash, INT2FIX(n)))) {
 | 
			
		||||
	ophash = rb_hash_new();
 | 
			
		||||
	HASH_ASET(ihash, INT2FIX(n), ophash);
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -3873,7 +3873,7 @@ vm_analysis_operand(int insn, int n, VALUE op)
 | 
			
		|||
    valstr = rb_insn_operand_intern(GET_EC()->cfp->iseq, insn, n, op, 0, 0, 0, 0);
 | 
			
		||||
 | 
			
		||||
    /* set count */
 | 
			
		||||
    if ((cv = rb_hash_aref(ophash, valstr)) == Qnil) {
 | 
			
		||||
    if (NIL_P(cv = rb_hash_aref(ophash, valstr))) {
 | 
			
		||||
	cv = INT2FIX(0);
 | 
			
		||||
    }
 | 
			
		||||
    HASH_ASET(ophash, valstr, INT2FIX(FIX2INT(cv) + 1));
 | 
			
		||||
| 
						 | 
				
			
			@ -3917,7 +3917,7 @@ vm_analysis_register(int reg, int isset)
 | 
			
		|||
    valstr = syms[reg][isset];
 | 
			
		||||
 | 
			
		||||
    uh = rb_const_get(rb_cRubyVM, usage_hash);
 | 
			
		||||
    if ((cv = rb_hash_aref(uh, valstr)) == Qnil) {
 | 
			
		||||
    if (NIL_P(cv = rb_hash_aref(uh, valstr))) {
 | 
			
		||||
	cv = INT2FIX(0);
 | 
			
		||||
    }
 | 
			
		||||
    HASH_ASET(uh, valstr, INT2FIX(FIX2INT(cv) + 1));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -604,7 +604,7 @@ setup_parameters_complex(rb_execution_context_t * const ec, const rb_iseq_t * co
 | 
			
		|||
      case arg_setup_method:
 | 
			
		||||
	break; /* do nothing special */
 | 
			
		||||
      case arg_setup_block:
 | 
			
		||||
        if (given_argc == (keyword_hash == Qnil ? 1 : 2) &&
 | 
			
		||||
        if (given_argc == (NIL_P(keyword_hash) ? 1 : 2) &&
 | 
			
		||||
            allow_autosplat &&
 | 
			
		||||
            (min_argc > 0 || iseq->body->param.opt_num > 1) &&
 | 
			
		||||
	    !iseq->body->param.flags.ambiguous_param0 &&
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1495,7 +1495,7 @@ rb_profile_frames(int start, int limit, VALUE *buff, int *lines)
 | 
			
		|||
static const rb_iseq_t *
 | 
			
		||||
frame2iseq(VALUE frame)
 | 
			
		||||
{
 | 
			
		||||
    if (frame == Qnil) return NULL;
 | 
			
		||||
    if (NIL_P(frame)) return NULL;
 | 
			
		||||
 | 
			
		||||
    if (RB_TYPE_P(frame, T_IMEMO)) {
 | 
			
		||||
	switch (imemo_type(frame)) {
 | 
			
		||||
| 
						 | 
				
			
			@ -1528,7 +1528,7 @@ rb_profile_frame_path(VALUE frame)
 | 
			
		|||
static const rb_callable_method_entry_t *
 | 
			
		||||
cframe(VALUE frame)
 | 
			
		||||
{
 | 
			
		||||
    if (frame == Qnil) return NULL;
 | 
			
		||||
    if (NIL_P(frame)) return NULL;
 | 
			
		||||
 | 
			
		||||
    if (RB_TYPE_P(frame, T_IMEMO)) {
 | 
			
		||||
	switch (imemo_type(frame)) {
 | 
			
		||||
| 
						 | 
				
			
			@ -1589,7 +1589,7 @@ rb_profile_frame_first_lineno(VALUE frame)
 | 
			
		|||
static VALUE
 | 
			
		||||
frame2klass(VALUE frame)
 | 
			
		||||
{
 | 
			
		||||
    if (frame == Qnil) return Qnil;
 | 
			
		||||
    if (NIL_P(frame)) return Qnil;
 | 
			
		||||
 | 
			
		||||
    if (RB_TYPE_P(frame, T_IMEMO)) {
 | 
			
		||||
	const rb_callable_method_entry_t *cme = (rb_callable_method_entry_t *)frame;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -962,7 +962,7 @@ vm_get_ev_const(rb_execution_context_t *ec, VALUE orig_klass, ID id, bool allow_
 | 
			
		|||
    void rb_const_warn_if_deprecated(const rb_const_entry_t *ce, VALUE klass, ID id);
 | 
			
		||||
    VALUE val;
 | 
			
		||||
 | 
			
		||||
    if (orig_klass == Qnil && allow_nil) {
 | 
			
		||||
    if (NIL_P(orig_klass) && allow_nil) {
 | 
			
		||||
	/* in current lexical scope */
 | 
			
		||||
        const rb_cref_t *root_cref = vm_get_cref(ec->cfp->ep);
 | 
			
		||||
	const rb_cref_t *cref;
 | 
			
		||||
| 
						 | 
				
			
			@ -5232,7 +5232,7 @@ VALUE rb_false(VALUE obj);
 | 
			
		|||
static VALUE
 | 
			
		||||
vm_opt_nil_p(const rb_iseq_t *iseq, CALL_DATA cd, VALUE recv)
 | 
			
		||||
{
 | 
			
		||||
    if (recv == Qnil &&
 | 
			
		||||
    if (NIL_P(recv) &&
 | 
			
		||||
        BASIC_OP_UNREDEFINED_P(BOP_NIL_P, NIL_REDEFINED_OP_FLAG)) {
 | 
			
		||||
        return Qtrue;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue