diff options
author | Jeremy Evans <[email protected]> | 2021-09-13 11:59:04 -0700 |
---|---|---|
committer | Jeremy Evans <[email protected]> | 2021-09-14 05:55:14 -0900 |
commit | 57d315c937e79199af2b77f21f5eecaca85ffac8 (patch) | |
tree | 2cb1f5530720afa596debc33a3d4c4ac10ca422c /hash.c | |
parent | 616d6717589abb30a5c67c79cbf874693c3dadbd (diff) |
Handle overwriting Object::ENV in spawn
Instead of looking for Object::ENV (which can be overwritten),
directly look for the envtbl variable. As that is static in hash.c,
and the lookup code is in process.c, add a couple non-static
functions that will return envtbl (or envtbl#to_hash).
Fixes [Bug #18164]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4834
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -6182,6 +6182,18 @@ env_to_hash(void) return hash; } +VALUE +rb_envtbl(void) +{ + return envtbl; +} + +VALUE +rb_env_to_hash(void) +{ + return env_to_hash(); +} + /* * call-seq: * ENV.to_hash -> hash of name/value pairs |