Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions include/ruby/internal/core/rtypeddata.h
Original file line number Diff line number Diff line change
Expand Up @@ -543,11 +543,10 @@ RTYPEDDATA_GET_DATA(VALUE obj)
}
#endif

/* We reuse the data pointer in embedded TypedData. We can't use offsetof
* since RTypedData a non-POD type in C++. */
const size_t embedded_typed_data_size = sizeof(struct RTypedData) - sizeof(void *);

return RTYPEDDATA_EMBEDDED_P(obj) ? (char *)obj + embedded_typed_data_size : RTYPEDDATA(obj)->data;
/* We reuse the data pointer in embedded TypedData. */
return RTYPEDDATA_EMBEDDED_P(obj) ?
RBIMPL_CAST((void *)&(RTYPEDDATA(obj)->data)) :
RTYPEDDATA(obj)->data;
}

RBIMPL_ATTR_PURE()
Expand Down
17 changes: 9 additions & 8 deletions test/ruby/test_process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -283,20 +283,21 @@ def test_overwrite_ENV
end

MANDATORY_ENVS = %w[RUBYLIB GEM_HOME GEM_PATH RUBY_FREE_AT_EXIT]
case RbConfig::CONFIG['target_os']
when /linux/
MANDATORY_ENVS << 'LD_PRELOAD'
when /mswin|mingw/
MANDATORY_ENVS.concat(%w[HOME USER TMPDIR PROCESSOR_ARCHITECTURE])
when /darwin/
MANDATORY_ENVS.concat(ENV.keys.grep(/\A__CF_/))
end
if e = RbConfig::CONFIG['LIBPATHENV']
MANDATORY_ENVS << e
end
if e = RbConfig::CONFIG['PRELOADENV'] and !e.empty?
MANDATORY_ENVS << e
end
case RbConfig::CONFIG['target_os']
when /mswin|mingw/
MANDATORY_ENVS.concat(%w[HOME USER TMPDIR PROCESSOR_ARCHITECTURE])
when /darwin/
MANDATORY_ENVS.concat(%w[TMPDIR], ENV.keys.grep(/\A__CF_/))
# IO.popen([ENV.keys.to_h {|e| [e, nil]},
# RUBY, "-e", %q[print ENV.keys.join(?\0)]],
# &:read).split(?\0)
end
PREENVARG = ['-e', "%w[#{MANDATORY_ENVS.join(' ')}].each{|e|ENV.delete(e)}"]
ENVARG = ['-e', 'ENV.each {|k,v| puts "#{k}=#{v}" }']
ENVCOMMAND = [RUBY].concat(PREENVARG).concat(ENVARG)
Expand Down
4 changes: 4 additions & 0 deletions tool/lib/vcs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,10 @@ def changelog_formatter(path, arg, base_url = nil)
s = s.join('')
end

s.gsub!(%r[(?!<\w)([-\w]+/[-\w]+)(?:@(\h{8,40})|#(\d{5,}))\b]) do
path = defined?($2) ? "commit/#{$2}" : "pull/#{$3}"
"[#$&](https://github.com/#{$1}/#{path})"
end
if %r[^ +(https://github\.com/[^/]+/[^/]+/)commit/\h+\n(?=(?: +\n(?i: +Co-authored-by: .*\n)+)?(?:\n|\Z))] =~ s
issue = "#{$1}pull/"
s.gsub!(/\b(?:(?i:fix(?:e[sd])?) +|GH-)\K#(?=\d+\b)|\(\K#(?=\d+\))/) {issue}
Expand Down