diff options
author | Alan Wu <[email protected]> | 2022-11-30 15:04:31 -0500 |
---|---|---|
committer | Alan Wu <[email protected]> | 2022-11-30 16:27:39 -0500 |
commit | 5752d11f1f33d277356373da749db111e03c96b5 (patch) | |
tree | 0d59152aa8fe241eb98f10dc85bddffc84420620 /struct.c | |
parent | 4b9d10b8330b5072993f2c32eaf701c5c1aa7e55 (diff) |
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.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6832
Diffstat (limited to 'struct.c')
-rw-r--r-- | struct.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |