Make B::OP::slabbed, folded, etc. actually work
authorFather Chrysostomos <sprout@cpan.org>
Sun, 15 Sep 2013 22:56:34 +0000 (15:56 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 16 Sep 2013 15:22:51 +0000 (08:22 -0700)
B::OP::slabbed       = 47
B::OP::savefree      = 48
B::OP::static        = 49
B::OP::folded        = 50

Added by 3164fde474, these have never worked, because the alias index
check in B::OP::next was never updated.

Instead of hard-coding the number, use C_ARRAY_LENGTH(...).

ext/B/B.xs

index ef34551..7866aec 100644 (file)
@@ -1011,7 +1011,7 @@ next(o)
     PREINIT:
        SV *ret;
     PPCODE:
-       if (ix < 0 || ix > 46)
+       if (ix < 0 || ix >= C_ARRAY_LENGTH(op_methods))
            croak("Illegal alias %d for B::*OP::next", (int)ix);
        ret = get_overlay_object(aTHX_ o,
                            op_methods[ix].name, op_methods[ix].namelen);