This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Perl_sv_vcatpvfn_flags: simplify wrap checking
authorDavid Mitchell <davem@iabyn.com>
Tue, 9 May 2017 14:55:07 +0000 (15:55 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 7 Jun 2017 08:11:00 +0000 (09:11 +0100)
commit075f29f481ebf101b77740c973de022de650189d
treea567994bc03b9a4bf6f1a6758f4038efca220602
parent24c4c352e63b4aa738dce7435a9e12968fd1006e
Perl_sv_vcatpvfn_flags: simplify wrap checking

The main SvGROW() has a new-length arg roughly equivalent to

    (SvCUR(sv) + elen + zeros + esignlen + dotstrlen + 1);

Rationalise the overflow/wrap checking by doing each individual addition
separately with its own check. This is slightly redundant as some of the
values are interdependent, but this way it's easier to see whether all
possible overflows are being checked for.

`
sv.c