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 .github/workflows/compilers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,6 @@ jobs:
- { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } }
- { uses: './.github/actions/compilers', name: 'VM_DEBUG_BP_CHECK', with: { cppflags: '-DVM_DEBUG_BP_CHECK' } }
- { uses: './.github/actions/compilers', name: 'VM_DEBUG_VERIFY_METHOD_CACHE', with: { cppflags: '-DVM_DEBUG_VERIFY_METHOD_CACHE' } }
- { uses: './.github/actions/compilers', name: 'enable-yjit', with: { append_configure: '--enable-yjit' } }
- { uses: './.github/actions/compilers', name: 'enable-{y,z}jit', with: { append_configure: '--enable-yjit --enable-zjit' } }
- { uses: './.github/actions/compilers', name: 'enable-{y,z}jit=dev', with: { append_configure: '--enable-yjit=dev --enable-zjit' } }
- { uses: './.github/actions/compilers', name: 'YJIT_FORCE_ENABLE', with: { cppflags: '-DYJIT_FORCE_ENABLE' } }
- { uses: './.github/actions/compilers', name: 'UNIVERSAL_PARSER', with: { cppflags: '-DUNIVERSAL_PARSER' } }

Expand Down
2 changes: 1 addition & 1 deletion ext/date/date_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3974,7 +3974,7 @@ rt_complete_frags(VALUE klass, VALUE hash)
rb_gc_register_mark_object(tab);
}

k = Qnil;
k = a = Qnil;

{
long i, eno = 0;
Expand Down
2 changes: 1 addition & 1 deletion include/ruby/internal/core/robject.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
*/
enum ruby_robject_flags {
/**
* This flag has marks that the object's instance variables are stored in an
* This flag marks that the object's instance variables are stored in an
* external heap buffer.
* Normally, instance variable references are stored inside the object slot,
* but if it overflow, Ruby may have to allocate a separate buffer and spills
Expand Down
38 changes: 16 additions & 22 deletions lib/prism/polyfill/warn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,29 @@
Kernel.prepend(
Module.new {
def warn(*msgs, uplevel: nil, category: nil) # :nodoc:
uplevel =
case uplevel
when nil
1
when Integer
uplevel + 1
else
uplevel.to_int + 1
end

super(*msgs, uplevel: uplevel)
case uplevel
when nil
super(*msgs)
when Integer
super(*msgs, uplevel: uplevel + 1)
else
super(*msgs, uplevel: uplevel.to_int + 1)
end
end
}
)

Object.prepend(
Module.new {
def warn(*msgs, uplevel: nil, category: nil) # :nodoc:
uplevel =
case uplevel
when nil
1
when Integer
uplevel + 1
else
uplevel.to_int + 1
end

super(*msgs, uplevel: uplevel)
case uplevel
when nil
super(*msgs)
when Integer
super(*msgs, uplevel: uplevel + 1)
else
super(*msgs, uplevel: uplevel.to_int + 1)
end
end
}
)
Expand Down
2 changes: 1 addition & 1 deletion pathname_builtin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def sub_ext(repl)
end

if File.dirname('A:') == 'A:.' # DOSish drive letter
# Regexp that matches an absoltute path.
# Regexp that matches an absolute path.
ABSOLUTE_PATH = /\A(?:[A-Za-z]:|#{SEPARATOR_PAT})/
else
ABSOLUTE_PATH = /\A#{SEPARATOR_PAT}/
Expand Down
18 changes: 9 additions & 9 deletions test/ruby/test_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,12 @@ def test_methods_prepend_singleton
assert_equal([:foo], k.private_methods(false))
end

class ToStrCounter
def initialize(str = "@foo") @str = str; @count = 0; end
def to_str; @count += 1; @str; end
def count; @count; end
end

def test_instance_variable_get
o = Object.new
o.instance_eval { @foo = :foo }
Expand All @@ -291,9 +297,7 @@ def test_instance_variable_get
assert_raise(NameError) { o.instance_variable_get("bar") }
assert_raise(TypeError) { o.instance_variable_get(1) }

n = Object.new
def n.to_str; @count = defined?(@count) ? @count + 1 : 1; "@foo"; end
def n.count; @count; end
n = ToStrCounter.new
assert_equal(:foo, o.instance_variable_get(n))
assert_equal(1, n.count)
end
Expand All @@ -308,9 +312,7 @@ def test_instance_variable_set
assert_raise(NameError) { o.instance_variable_set("bar", 1) }
assert_raise(TypeError) { o.instance_variable_set(1, 1) }

n = Object.new
def n.to_str; @count = defined?(@count) ? @count + 1 : 1; "@foo"; end
def n.count; @count; end
n = ToStrCounter.new
o.instance_variable_set(n, :bar)
assert_equal(:bar, o.instance_eval { @foo })
assert_equal(1, n.count)
Expand All @@ -327,9 +329,7 @@ def test_instance_variable_defined
assert_raise(NameError) { o.instance_variable_defined?("bar") }
assert_raise(TypeError) { o.instance_variable_defined?(1) }

n = Object.new
def n.to_str; @count = defined?(@count) ? @count + 1 : 1; "@foo"; end
def n.count; @count; end
n = ToStrCounter.new
assert_equal(true, o.instance_variable_defined?(n))
assert_equal(1, n.count)
end
Expand Down