diff options
author | David Mitchell <davem@iabyn.com> | 2014-02-26 22:39:52 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2014-02-27 16:16:18 +0000 |
commit | 89a18b40609cfdfc4af7414a628064c743b836bd (patch) | |
tree | 3a3593f6879db35470c84ea4af224ab860ed2777 /pp_hot.c | |
parent | 3f44dc817bc788142268d4c17f46269d4468fb57 (diff) | |
download | perl-89a18b40609cfdfc4af7414a628064c743b836bd.tar.gz |
pp_entersub(): simplify XSUB arg cleanup code
The code that reduces the returned XS args to 1 arg in scalar context
was a bit messy. This makes it smaller, more comprehensible, with slighylu
smaller object size.
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -2777,12 +2777,12 @@ try_autoload: CvXSUB(cv)(aTHX_ cv); /* Enforce some sanity in scalar context. */ - if (gimme == G_SCALAR && ++markix != PL_stack_sp - PL_stack_base ) { - if (markix > PL_stack_sp - PL_stack_base) - *(PL_stack_base + markix) = &PL_sv_undef; - else - *(PL_stack_base + markix) = *PL_stack_sp; - PL_stack_sp = PL_stack_base + markix; + if (gimme == G_SCALAR) { + SV **svp = PL_stack_base + markix + 1; + if (svp != PL_stack_sp) { + *svp = svp > PL_stack_sp ? &PL_sv_undef : *PL_stack_sp; + PL_stack_sp = svp; + } } LEAVE; return NORMAL; |