diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-01 13:56:55 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-01 13:56:55 +0900 |
commit | 99dc885974bfe637f3e74f52efdbbf77d66d0d68 (patch) | |
tree | 5ac459dc3dcb36217fe674a0936ed4f8d361315b /ext/-test-/symbol | |
parent | 6982a9049ede1386fdfa10734f953867824ebe05 (diff) | |
download | ruby-99dc885974bfe637f3e74f52efdbbf77d66d0d68.tar.gz |
Fixed inadvertent ID creation in rb_iv_get
Diffstat (limited to 'ext/-test-/symbol')
-rw-r--r-- | ext/-test-/symbol/init.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/-test-/symbol/init.c b/ext/-test-/symbol/init.c index 20cf2fa079..4038701ac9 100644 --- a/ext/-test-/symbol/init.c +++ b/ext/-test-/symbol/init.c @@ -20,6 +20,13 @@ sym_pinneddown_p(VALUE dummy, VALUE sym) #endif } +static VALUE +sym_iv_get(VALUE dummy, VALUE obj, VALUE name) +{ + const char *n = StringValueCStr(name); + return rb_iv_get(obj, n); +} + void Init_symbol(void) { @@ -27,5 +34,6 @@ Init_symbol(void) VALUE klass = rb_define_class_under(mBug, "Symbol", rb_cSymbol); rb_define_singleton_method(klass, "find", sym_find, 1); rb_define_singleton_method(klass, "pinneddown?", sym_pinneddown_p, 1); + rb_define_singleton_method(klass, "iv_get", sym_iv_get, 2); TEST_INIT_FUNCS(init); } |