Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -10926,10 +10926,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const no
}

case NODE_MASGN:{
bool prev_in_masgn = ISEQ_COMPILE_DATA(iseq)->in_masgn;
ISEQ_COMPILE_DATA(iseq)->in_masgn = true;
compile_massign(iseq, ret, node, popped);
ISEQ_COMPILE_DATA(iseq)->in_masgn = prev_in_masgn;
break;
}

Expand Down
6 changes: 3 additions & 3 deletions complex.c
Original file line number Diff line number Diff line change
Expand Up @@ -1226,10 +1226,10 @@ rb_complex_pow(VALUE self, VALUE other)

/*
* call-seq:
* complex == object -> true or false
* self == other -> true or false
*
* Returns +true+ if <tt>self.real == object.real</tt>
* and <tt>self.imag == object.imag</tt>:
* Returns whether both <tt>self.real == other.real</tt>
* and <tt>self.imag == other.imag</tt>:
*
* Complex.rect(2, 3) == Complex.rect(2.0, 3.0) # => true
*
Expand Down
4 changes: 2 additions & 2 deletions error.c
Original file line number Diff line number Diff line change
Expand Up @@ -2159,9 +2159,9 @@ try_convert_to_exception(VALUE obj)

/*
* call-seq:
* self == object -> true or false
* self == other -> true or false
*
* Returns whether +object+ is the same class as +self+
* Returns whether +other+ is the same class as +self+
* and its #message and #backtrace are equal to those of +self+.
*
*/
Expand Down
14 changes: 5 additions & 9 deletions hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -3980,17 +3980,13 @@ hash_equal(VALUE hash1, VALUE hash2, int eql)

/*
* call-seq:
* self == object -> true or false
* self == other -> true or false
*
* Returns whether +self+ and +object+ are equal.
* Returns whether all of the following are true:
*
* Returns +true+ if all of the following are true:
*
* - +object+ is a +Hash+ object (or can be converted to one).
* - +self+ and +object+ have the same keys (regardless of order).
* - For each key +key+, <tt>self[key] == object[key]</tt>.
*
* Otherwise, returns +false+.
* - +other+ is a +Hash+ object (or can be converted to one).
* - +self+ and +other+ have the same keys (regardless of order).
* - For each key +key+, <tt>self[key] == other[key]</tt>.
*
* Examples:
*
Expand Down
4 changes: 4 additions & 0 deletions iseq.c
Original file line number Diff line number Diff line change
Expand Up @@ -3345,6 +3345,7 @@ iseq_type_id(enum rb_iseq_type type)
static VALUE
iseq_data_to_ary(const rb_iseq_t *iseq)
{
VALUE iseq_value = (VALUE)iseq;
unsigned int i;
long l;
const struct rb_iseq_constant_body *const iseq_body = ISEQ_BODY(iseq);
Expand Down Expand Up @@ -3677,6 +3678,9 @@ iseq_data_to_ary(const rb_iseq_t *iseq)
rb_ary_push(val, params);
rb_ary_push(val, exception);
rb_ary_push(val, body);

RB_GC_GUARD(iseq_value);

return val;
}

Expand Down
1 change: 0 additions & 1 deletion iseq.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ struct iseq_compile_data {
struct iseq_compile_data_storage *storage_current;
} insn;
bool in_rescue;
bool in_masgn;
int loopval_popped; /* used by NODE_BREAK */
int last_line;
int label_no;
Expand Down
1 change: 1 addition & 0 deletions lib/time.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Gem::Specification.new do |spec|

spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = spec.homepage
spec.metadata["changelog_uri"] = "https://github.com/ruby/time/releases"

srcdir, gemspec = File.split(__FILE__)
spec.files = Dir.chdir(srcdir) do
Expand Down
4 changes: 2 additions & 2 deletions numeric.c
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,7 @@ num_equal(VALUE x, VALUE y)
* call-seq:
* self == other -> true or false
*
* Returns +true+ if +other+ has the same value as +self+, +false+ otherwise:
* Returns whether +other+ is numerically equal to +self+:
*
* 2.0 == 2 # => true
* 2.0 == 2.0 # => true
Expand Down Expand Up @@ -4852,7 +4852,7 @@ fix_equal(VALUE x, VALUE y)
* call-seq:
* self == other -> true or false
*
* Returns +true+ if +self+ is numerically equal to +other+; +false+ otherwise.
* Returns whether +self+ is numerically equal to +other+:
*
* 1 == 2 #=> false
* 1 == 1.0 #=> true
Expand Down
20 changes: 12 additions & 8 deletions object.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,18 @@ rb_eql(VALUE obj1, VALUE obj2)

/**
* call-seq:
* obj == other -> true or false
* obj.equal?(other) -> true or false
* obj.eql?(other) -> true or false
*
* Equality --- At the Object level, #== returns <code>true</code>
* only if +obj+ and +other+ are the same object. Typically, this
* method is overridden in descendant classes to provide
* class-specific meaning.
* self == other -> true or false
* equal?(other) -> true or false
* eql?(other) -> true or false
*
* Returns whether +self+ and +other+ are the same object:
*
* object = Object.new
* object == object # => true
* object == Object.new # => false
*
* Here in class \Object, #==, #equal?, and #eql? are the same method.
* A subclass may override #== to provide class-specific meaning.
*
* Unlike #==, the #equal? method should never be overridden by
* subclasses as it is used to determine object identity (that is,
Expand Down
11 changes: 5 additions & 6 deletions proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1423,10 +1423,10 @@ rb_proc_get_iseq(VALUE self, int *is_proc)
}

/* call-seq:
* prc == other -> true or false
* prc.eql?(other) -> true or false
* self == other -> true or false
* eql?(other) -> true or false
*
* Two procs are the same if, and only if, they were created from the same code block.
* Returns whether +self+ and +other+ were created from the same code block:
*
* def return_block(&block)
* block
Expand Down Expand Up @@ -1980,10 +1980,9 @@ method_entry_defined_class(const rb_method_entry_t *me)

/*
* call-seq:
* meth.eql?(other_meth) -> true or false
* meth == other_meth -> true or false
* self == other -> true or false
*
* Two method objects are equal if they are bound to the same
* Returns whether +self+ and +other+ are bound to the same
* object and refer to the same method definition and the classes
* defining the methods are the same class or module.
*/
Expand Down
4 changes: 2 additions & 2 deletions range.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,14 @@ recursive_equal(VALUE range, VALUE obj, int recur)
* call-seq:
* self == other -> true or false
*
* Returns +true+ if and only if:
* Returns whether all of the following are true:
*
* - +other+ is a range.
* - <tt>other.begin == self.begin</tt>.
* - <tt>other.end == self.end</tt>.
* - <tt>other.exclude_end? == self.exclude_end?</tt>.
*
* Otherwise returns +false+.
* Examples:
*
* r = (1..5)
* r == (1..5) # => true
Expand Down
4 changes: 2 additions & 2 deletions rational.c
Original file line number Diff line number Diff line change
Expand Up @@ -1145,9 +1145,9 @@ rb_rational_cmp(VALUE self, VALUE other)

/*
* call-seq:
* rat == object -> true or false
* self == other -> true or false
*
* Returns +true+ if +rat+ equals +object+ numerically.
* Returns whether +self+ and +other+ are numerically equal:
*
* Rational(2, 3) == Rational(2, 3) #=> true
* Rational(5) == 5 #=> true
Expand Down
12 changes: 6 additions & 6 deletions re.c
Original file line number Diff line number Diff line change
Expand Up @@ -3544,10 +3544,10 @@ reg_hash(VALUE re)

/*
* call-seq:
* regexp == object -> true or false
* self == other -> true or false
*
* Returns +true+ if +object+ is another \Regexp whose pattern,
* flags, and encoding are the same as +self+, +false+ otherwise:
* Returns whether +other+ is another \Regexp whose pattern,
* flags, and encoding are the same as +self+:
*
* /foo/ == Regexp.new('foo') # => true
* /foo/ == /foo/i # => false
Expand Down Expand Up @@ -3599,11 +3599,11 @@ match_hash(VALUE match)

/*
* call-seq:
* matchdata == object -> true or false
* self == other -> true or false
*
* Returns +true+ if +object+ is another \MatchData object
* Returns whether +other+ is another \MatchData object
* whose target string, regexp, match, and captures
* are the same as +self+, +false+ otherwise.
* are the same as +self+.
*/

static VALUE
Expand Down
18 changes: 9 additions & 9 deletions string.c
Original file line number Diff line number Diff line change
Expand Up @@ -4239,11 +4239,11 @@ rb_str_cmp(VALUE str1, VALUE str2)

/*
* call-seq:
* self == object -> true or false
* self == other -> true or false
*
* Returns whether +object+ is equal to +self+.
* Returns whether +other+ is equal to +self+.
*
* When +object+ is a string, returns whether +object+ has the same length and content as +self+:
* When +other+ is a string, returns whether +other+ has the same length and content as +self+:
*
* s = 'foo'
* s == 'foo' # => true
Expand All @@ -4254,11 +4254,11 @@ rb_str_cmp(VALUE str1, VALUE str2)
*
* "\u{e4 f6 fc}".encode(Encoding::ISO_8859_1) == ("\u{c4 d6 dc}") # => false
*
* When +object+ is not a string:
* When +other+ is not a string:
*
* - If +object+ responds to method <tt>to_str</tt>,
* <tt>object == self</tt> is called and its return value is returned.
* - If +object+ does not respond to <tt>to_str</tt>,
* - If +other+ responds to method <tt>to_str</tt>,
* <tt>other == self</tt> is called and its return value is returned.
* - If +other+ does not respond to <tt>to_str</tt>,
* +false+ is returned.
*
* Related: {Comparing}[rdoc-ref:String@Comparing].
Expand Down Expand Up @@ -12218,9 +12218,9 @@ rb_str_unicode_normalized_p(int argc, VALUE *argv, VALUE str)

/*
* call-seq:
* symbol == object -> true or false
* self == other -> true or false
*
* Returns +true+ if +object+ is the same object as +self+, +false+ otherwise.
* Returns whether +other+ is the same object as +self+.
*/

#define sym_equal rb_obj_equal
Expand Down
4 changes: 2 additions & 2 deletions struct.c
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,7 @@ recursive_equal(VALUE s, VALUE s2, int recur)
* call-seq:
* self == other -> true or false
*
* Returns +true+ if and only if the following are true; otherwise returns +false+:
* Returns whether both the following are true:
*
* - <tt>other.class == self.class</tt>.
* - For each member name +name+, <tt>other.name == self.name</tt>.
Expand Down Expand Up @@ -1918,7 +1918,7 @@ rb_data_inspect(VALUE s)
* call-seq:
* self == other -> true or false
*
* Returns +true+ if +other+ is the same class as +self+, and all members are
* Returns whether +other+ is the same class as +self+, and all members are
* equal.
*
* Examples:
Expand Down