From b77b7c30d4855734384a095db41a734d315bb8fa Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 1 Feb 2000 03:12:21 +0000 Subject: 2000-02-01 git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- struct.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'struct.c') diff --git a/struct.c b/struct.c index 145c2e5b4..2fd769003 100644 --- a/struct.c +++ b/struct.c @@ -474,6 +474,7 @@ rb_struct_aset_id(s, id, val) rb_bug("non-initialized struct"); } + if (OBJ_FROZEN(s)) rb_error_frozen("Struct"); len = RARRAY(member)->len; for (i=0; iptr[i]) == id) { @@ -502,6 +503,7 @@ rb_struct_aset(s, idx, val) if (RSTRUCT(s)->len <= i) rb_raise(rb_eIndexError, "offset %d too large for struct(size:%d)", i, RSTRUCT(s)->len); + if (OBJ_FROZEN(s)) rb_error_frozen("Struct"); return RSTRUCT(s)->ptr[i] = val; } -- cgit