From: "kddnewton (Kevin Newton) via ruby-core" <ruby-core@...>
Date: 2024-02-09T15:16:51+00:00
Subject: [ruby-core:116654] [Ruby master Misc#20222] Dedup-ing clarification

Issue #20222 has been updated by kddnewton (Kevin Newton).

Status changed from Open to Closed

Thank you! This helps explain it.

----------------------------------------
Misc #20222: Dedup-ing clarification
https://bugs.ruby-lang.org/issues/20222#change-106663

* Author: kddnewton (Kevin Newton)
* Status: Closed
* Priority: Normal
----------------------------------------
``` ruby
source = %q{"foo".freeze.equal?("foo".freeze)}

RubyVM::InstructionSequence.compile(source).eval # => true
RubyVM::InstructionSequence.compile_option = false
RubyVM::InstructionSequence.compile(source).eval # => false
```

`"foo".freeze` uses `opt_str_freeze` when optimizations are turned on, which also deduplicates. This means this code has different behavior depending on if optimizations are turned on or off.

To be clear, I'm not saying whether or not this is a problem. I'm asking if this is desired behavior?



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/