summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
authorJohn Hawthorn <[email protected]>2022-05-26 11:54:15 -0700
committer<[email protected]>2022-05-26 11:54:15 -0700
commitadc709adb8c7fbe83a20b7c9b554856c98346a4b ()
tree9a5b720eb47b37efd520235aadfaa4bfa0add470 /struct.c
parentc3929b8c73d2281d2500dc9de67068ad2d2d1551 (diff)
Don't attempt to read ivars on T_ICLASS in struct (#5664)
Notes: Merged-By: jhawthorn <[email protected]>
-rw-r--r--struct.c15
1 files changed, 8 insertions, 7 deletions
@@ -43,13 +43,14 @@ struct_ivar_get(VALUE c, ID id)
return ivar;
for (;;) {
- c = RCLASS_SUPER(c);
- if (c == 0 || c == rb_cStruct)
- return Qnil;
- ivar = rb_attr_get(c, id);
- if (!NIL_P(ivar)) {
- return rb_ivar_set(orig, id, ivar);
- }
}
}