[ruby-core:93254] [Ruby trunk Bug#15941] Issue with String#scrub when given block and receiver is modified in block
From:
luke.gru@...
Date:
2019-06-19 16:21:38 UTC
List:
ruby-core #93254
Issue #15941 has been updated by luke-gru (Luke Gruber).
This causes a segmentation fault:
```
s = "abc\u3042\xE3\x80"
loop do
s.scrub{|bytes| s << "more content"; "?" }
end
```
Not something that should occur in real code, but nevertheless a bug.
Thank you for your time :)
----------------------------------------
Bug #15941: Issue with String#scrub when given block and receiver is modified in block
https://bugs.ruby-lang.org/issues/15941#change-78703
* Author: luke-gru (Luke Gruber)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v:
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
This should cause a segmentation fault:
```ruby
s = "abc\u3042\xE3\x80"
loop do
s.scrub{|bytes| s << "more content"; "?" }
end
```
Not something that should happen, but I thought it might cause undesired behavior.
Thank you for your time :)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>