From: luke.gru@... Date: 2019-06-19T16:10:48+00:00 Subject: [ruby-core:93253] [Ruby trunk Bug#15941] Issue with String#scrub when given block and receiver is modified in block Issue #15941 has been updated by luke-gru (Luke Gruber). I guess the solution here would be something similar to `String#gsub`, temporarily freeze the receiver. ---------------------------------------- Bug #15941: Issue with String#scrub when given block and receiver is modified in block https://bugs.ruby-lang.org/issues/15941#change-78702 * 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: