summaryrefslogtreecommitdiff
path: root/ext/psych/lib/psych
diff options
context:
space:
mode:
Diffstat (limited to 'ext/psych/lib/psych')
-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 2562816344..b8eb698754 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