This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_last: use debugging LEAVE variant
authorDavid Mitchell <davem@iabyn.com>
Fri, 17 Jul 2015 22:22:29 +0000 (23:22 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 3 Feb 2016 08:59:38 +0000 (08:59 +0000)
Make the two LEAVEs in pp_last() be instead

    LEAVE_with_name("loop2");
    LEAVE_with_name("loop1");

which is more self-documenting and will trap mistakes on DEBUGGING builds

pp_ctl.c

index 85ae4d3..cef91f5 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2536,11 +2536,11 @@ PP(pp_last)
     TAINT_NOT;
     PL_stack_sp = newsp;
 
-    LEAVE;
+    LEAVE_with_name("loop2");
     cxstack_ix--;
     /* Stack values are safe: */
     POPLOOP(cx);       /* release loop vars ... */
-    LEAVE;
+    LEAVE_with_name("loop1");
     PL_curpm = newpm;  /* ... and pop $1 et al */
 
     PERL_UNUSED_VAR(gimme);