Skip to content

[GR-50208] Boxed parameter is not trusted #3872

Open
@chrisseaton

Description

@chrisseaton

Related to #3101, @davleopo.

def foo(x)
  x.times do |n|
    if (n % 5 == 0) && (n % 3 == 0)
      out :fizzbuzz
    elsif n % 5 == 0
      out :fizz
    elsif n % 3 == 0
      out :buzz
    else
      out n
    end
  end
end

def out(x)
end

loop do
  foo(rand(100))
end

Screenshot 2021-10-06 at 14 15 52

Looking at node 161. How come 167 is trusted but 2085 isn't? 2085 is returned, and because it isn't trusted, it's reboxed, leaving us with a unbox-box operation.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions