mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Use RTEST and add test for GH-6832
Technically we shouldn't see Qfalse now, but RTEST also compiles down to just one branch anyways. Pretty contrived issue, but easy to fix.
This commit is contained in:
parent
4b9d10b833
commit
5752d11f1f
Notes:
git
2022-11-30 21:28:03 +00:00
2 changed files with 9 additions and 1 deletions
2
struct.c
2
struct.c
|
@ -48,7 +48,7 @@ struct_ivar_get(VALUE c, ID id)
|
|||
|
||||
for (;;) {
|
||||
c = rb_class_superclass(c);
|
||||
if (c == 0 || c == rb_cStruct || c == rb_cData || c == Qnil)
|
||||
if (c == rb_cStruct || c == rb_cData || !RTEST(c))
|
||||
return Qnil;
|
||||
RUBY_ASSERT(RB_TYPE_P(c, T_CLASS));
|
||||
ivar = rb_attr_get(c, id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue