summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-02-01 03:12:21 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-02-01 03:12:21 +0000
commite4b53b22228d935847b72e8f9ab0f49a15b54215 (patch)
treeae6cd78921bf626d54145b5485474bf59c3dceb4 /struct.c
parent005f12582975d8382851b740690f97dba35aaa2a (diff)
2000-02-01
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/struct.c b/struct.c
index 145c2e5..2fd7690 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; i<len; i++) {
if (FIX2UINT(RARRAY(member)->ptr[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;
}