diff options
Diffstat (limited to 'ext/B/B.xs')
-rw-r--r-- | ext/B/B.xs | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/ext/B/B.xs b/ext/B/B.xs index 813ad8ff10..fa72c9ee47 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -1582,20 +1582,19 @@ SvRV(sv) MODULE = B PACKAGE = B::REGEXP -IV -REGEX(sv) - B::REGEXP sv - CODE: - /* FIXME - can we code this method more efficiently? */ - RETVAL = PTR2IV(sv); - OUTPUT: - RETVAL - void -precomp(sv) +REGEX(sv) B::REGEXP sv + ALIAS: + precomp = 1 PPCODE: - PUSHs(newSVpvn_flags(RX_PRECOMP(sv), RX_PRELEN(sv), SVs_TEMP)); + if (ix) { + PUSHs(newSVpvn_flags(RX_PRECOMP(sv), RX_PRELEN(sv), SVs_TEMP)); + } else { + dXSTARG; + /* FIXME - can we code this method more efficiently? */ + PUSHi(PTR2IV(sv)); + } #endif |