From d4b1f56f50903403cb75451215298ceb56f2302c Mon Sep 17 00:00:00 2001 From: jinroq <2787780+jinroq@users.noreply.github.com> Date: Sun, 3 Dec 2023 06:17:53 +0900 Subject: [Fix] Support when nil is assigned to variable `name` (#9105) * Add `!name.nil?` to if condition --- lib/ruby_vm/rjit/c_pointer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/ruby_vm') diff --git a/lib/ruby_vm/rjit/c_pointer.rb b/lib/ruby_vm/rjit/c_pointer.rb index d65d5a93a5..1a84896822 100644 --- a/lib/ruby_vm/rjit/c_pointer.rb +++ b/lib/ruby_vm/rjit/c_pointer.rb @@ -338,7 +338,7 @@ module RubyVM::RJIT # Give a name to a dynamic CPointer class to see it on inspect def self.with_class_name(prefix, name, cache: false, &block) - return block.call if name.empty? + return block.call if !name.nil? && name.empty? # Use a cached result only if cache: true class_name = "#{prefix}_#{name}" -- cgit v1.2.3