mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
2000-02-01
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
005f125829
commit
e4b53b2222
37 changed files with 1603 additions and 691 deletions
2
struct.c
2
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue