aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ostruct.rb
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-01 17:27:38 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-01 17:27:38 +0000
commit5408d00b7eec040aa60f010c08fffd8d36d39a40 (patch)
tree39520e93bcd71a5482ba12f5f3fea6ab690f1d46 /lib/ostruct.rb
parent32434a7a24d8bf6312d8e149148de7b336e2f1fa (diff)
downloadruby-5408d00b7eec040aa60f010c08fffd8d36d39a40.tar.gz
* lib/ostruct.rb: Fix case of frozen object with initializer.
Bug revealed by RubySpec [ruby-core:72639] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/ostruct.rb')
-rw-r--r--lib/ostruct.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ostruct.rb b/lib/ostruct.rb
index 17efcdc8d3..a95a0f1963 100644
--- a/lib/ostruct.rb
+++ b/lib/ostruct.rb
@@ -195,7 +195,7 @@ class OpenStruct
modifiable[new_ostruct_member(mname)] = args[0]
elsif len == 0
if @table.key?(mid)
- new_ostruct_member(mid)
+ new_ostruct_member(mid) unless frozen?
@table[mid]
end
else