From: luke.gru@... Date: 2019-06-19T19:36:20+00:00 Subject: [ruby-core:93260] [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). Patch lgtm, thanks! In case someone can't replicate the issue because of the invalid UTF-8 string literal, I ran it with miniruby, not ruby. ---------------------------------------- Bug #15941: Issue with String#scrub when given block and receiver is modified in block https://bugs.ruby-lang.org/issues/15941#change-78720 * 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 :) ---Files-------------------------------- scrub-modify-check.patch (3.82 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: