len = 256;
} else if (ix == 2) {
/* This used to read 257. I think that that was buggy - should have
- been 258. (The "\0", the flags byte, and 256 for the table. Not
- that anything anywhere calls this method. NWC. */
- /* Also, the start pointer has always been SvPVX(sv). Surely it
- should be SvPVX(sv) + SvCUR(sv)? The code has faithfully been
- refactored with this behaviour, since PVBM was added in
- 651aa52ea1faa806. */
+ been 258. (The "\0", the flags byte, and 256 for the table.)
+ The only user of this method is B::Bytecode in B::PV::bsave.
+ I'm guessing that nothing tested the runtime correctness of
+ output of bytecompiled string constant arguments to index (etc).
+
+ Note the start pointer is and has always been SvPVX(sv), not
+ SvPVX(sv) + SvCUR(sv) PVBM was added in 651aa52ea1faa806, and
+ first used by the compiler in 651aa52ea1faa806. It's used to
+ get a "complete" dump of the buffer at SvPVX(), not just the
+ PVBM table. This permits the generated bytecode to "load"
+ SvPVX in "one" hit. */
p = SvPVX_const(sv);
len = SvCUR(sv) + (SvVALID(sv) ? 256 + PERL_FBM_TABLE_OFFSET : 0);
} else if (ix) {