From 21daa56b2aa2d4afc6e61b0e6b0f4dd78df620ca Mon Sep 17 00:00:00 2001 From: naruse Date: Tue, 2 Feb 2016 04:39:44 +0000 Subject: * re.c: Introduce RREGEXP_PTR. patch by dbussink. partially merge https://github.com/ruby/ruby/pull/497 * include/ruby/ruby.h: ditto. * gc.c: ditto. * ext/strscan/strscan.c: ditto. * parse.y: ditto. * string.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/strscan/strscan.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ext/strscan') diff --git a/ext/strscan/strscan.c b/ext/strscan/strscan.c index f7592c9249..e75bf6639c 100644 --- a/ext/strscan/strscan.c +++ b/ext/strscan/strscan.c @@ -460,7 +460,7 @@ strscan_do_scan(VALUE self, VALUE regex, int succptr, int getstr, int headonly) p->regex = regex; re = rb_reg_prepare_re(regex, p->str); - tmpreg = re != RREGEXP(regex)->ptr; + tmpreg = re != RREGEXP_PTR(regex); if (!tmpreg) RREGEXP(regex)->usecnt++; if (headonly) { @@ -480,8 +480,8 @@ strscan_do_scan(VALUE self, VALUE regex, int succptr, int getstr, int headonly) onig_free(re); } else { - onig_free(RREGEXP(regex)->ptr); - RREGEXP(regex)->ptr = re; + onig_free(RREGEXP_PTR(regex)); + RREGEXP_PTR(regex) = re; } } @@ -978,7 +978,7 @@ name_to_backref_number(struct re_registers *regs, VALUE regexp, const char* name { int num; - num = onig_name_to_backref_number(RREGEXP(regexp)->ptr, + num = onig_name_to_backref_number(RREGEXP_PTR(regexp), (const unsigned char* )name, (const unsigned char* )name_end, regs); if (num >= 1) { return num; -- cgit v1.2.3