This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_entersub(): remove an unnecessary condition
authorDavid Mitchell <davem@iabyn.com>
Sat, 11 Jul 2015 12:10:00 +0000 (13:10 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 3 Feb 2016 08:59:36 +0000 (08:59 +0000)
commit91bab027a8757b89037a9c5193baeb4b64d32322
treed004c47c0103d8ce7be7dd224c5bf30f5b51d2aa
parent20448bada861fed6903ee792b001246a54e04e33
pp_entersub(): remove an unnecessary condition

The code that scans the args list making mortal copies is protected by an

    if (LIKELY(hasargs)) {

However, a sub called as "&foo;" (which is how hasargs is determined)
won't have pushed anything on the stack, so the first part of that code
block, "while (svp < SP)", will drop out immediately.

So skip doing the hasargs test.

NB - it's possible in theory for XS code to call call_sv() jn such a way
as to both have !hasargs but with stuff on the stack; in this worst case,
we just waste a bit of time making some mortal copies of those args.
pp_hot.c