aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ruby_vm
diff options
context:
space:
mode:
authorjinroq <2787780+jinroq@users.noreply.github.com>2023-12-03 06:17:53 +0900
committerGitHub <noreply@github.com>2023-12-02 13:17:53 -0800
commitd4b1f56f50903403cb75451215298ceb56f2302c (patch)
tree8f0ba35bfac916f2c52c7c2bfdc99f5278dded4b /lib/ruby_vm
parentad54fbf281ca1935e79f4df1460b0106ba76761e (diff)
downloadruby-d4b1f56f50903403cb75451215298ceb56f2302c.tar.gz
[Fix] Support when nil is assigned to variable `name` (#9105)
* Add `!name.nil?` to if condition
Diffstat (limited to 'lib/ruby_vm')
-rw-r--r--lib/ruby_vm/rjit/c_pointer.rb2
1 files changed, 1 insertions, 1 deletions
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}"