summaryrefslogtreecommitdiff
path: root/ext/psych/lib/psych/visitors/to_ruby.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/psych/lib/psych/visitors/to_ruby.rb')
-rw-r--r--ext/psych/lib/psych/visitors/to_ruby.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/psych/lib/psych/visitors/to_ruby.rb b/ext/psych/lib/psych/visitors/to_ruby.rb
index 2562816344d..b8eb6987543 100644
--- a/ext/psych/lib/psych/visitors/to_ruby.rb
+++ b/ext/psych/lib/psych/visitors/to_ruby.rb
@@ -182,7 +182,6 @@ module Psych
when /^!ruby\/object:?(.*)?$/
name = $1 || 'Object'
obj = revive((resolve_class(name) || Object), o)
- @st[o.anchor] = obj if o.anchor
obj
when /^!map:(.*)$/, /^!ruby\/hash:(.*)$/
@@ -233,6 +232,7 @@ module Psych
def revive klass, node
s = klass.allocate
+ @st[node.anchor] = s if node.anchor
h = Hash[*node.children.map { |c| accept c }]
init_with(s, h, node)
end