[ruby-core:111800] [Ruby master Bug#19336] Backport commit eab7f4623fbf0488e828b75843d70c8e02dc8aa5