In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/30773234952bc812474fe0c956f7ce14e822e0cd?hp=7a4fcb3f64df51eacf89f69a4bf76386aea1e8e3>

- Log -----------------------------------------------------------------
commit 30773234952bc812474fe0c956f7ce14e822e0cd
Author: David Mitchell <da...@iabyn.com>
Date:   Wed Dec 2 12:04:08 2015 +0000

    markstack_grow(): fix debugging stuff
    
    This is a follow-on to commit ac07059afc75:
    
        FOOMARK debugging macros: fix %d cast; only -Dsv
    
    which missed fixing up the debugging statement in markstack_grow().

M       scope.c

commit 473edb6554ba163273fdcd621aab071bffbb16d3
Author: David Mitchell <da...@iabyn.com>
Date:   Wed Dec 2 11:49:04 2015 +0000

    rpeep(): silence  compiler warning
    
    op.c: In function ‘Perl_rpeep’:
    op.c:13666:35: warning: comparison is always false due to limited range of 
data
    type [-Wtype-limits]
    
    This condition is always false if for example base is 32 bit and UVs are 64
    bit:
    
        base >  (UV_MAX >> (OPpPADRANGE_COUNTSHIFT+SAVE_TIGHT_SHIFT)
    
    silence the warning by replacing base with a constant-folded conditional
    
        (cond ? base : 0) > ....
    
    where cond is false if sizeof(base) is small.

M       op.c
-----------------------------------------------------------------------

Summary of changes:
 op.c    | 14 +++++++++++---
 scope.c |  5 +++--
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/op.c b/op.c
index 168aef3..d8dfbd3 100644
--- a/op.c
+++ b/op.c
@@ -13662,9 +13662,17 @@ Perl_rpeep(pTHX_ OP *o)
                     break;
 
                 /* there's a biggest base we can fit into a
-                 * SAVEt_CLEARPADRANGE in pp_padrange */
-                if (intro && base >
-                        (UV_MAX >> (OPpPADRANGE_COUNTSHIFT+SAVE_TIGHT_SHIFT)))
+                 * SAVEt_CLEARPADRANGE in pp_padrange.
+                 * (The sizeof() stuff will be constant-folded, and is
+                 * intended to avoid getting "comparison is always false"
+                 * compiler warnings)
+                 */
+                if (   intro
+                    && (8*sizeof(base) >
+                        8*sizeof(UV)-OPpPADRANGE_COUNTSHIFT-SAVE_TIGHT_SHIFT
+                        ? base : 0) >
+                        (UV_MAX >> (OPpPADRANGE_COUNTSHIFT+SAVE_TIGHT_SHIFT))
+                )
                     break;
 
                 /* Success! We've got another valid pad op to optimise away */
diff --git a/scope.c b/scope.c
index 037bbc0..7df465f 100644
--- a/scope.c
+++ b/scope.c
@@ -131,8 +131,9 @@ Perl_markstack_grow(pTHX)
     Renew(PL_markstack, newmax, I32);
     PL_markstack_max = PL_markstack + newmax;
     PL_markstack_ptr = PL_markstack + oldmax;
-    DEBUG_s(PerlIO_printf(Perl_debug_log, "MARK grow %p %d by %d\n",
-            PL_markstack_ptr, *PL_markstack_ptr, oldmax));
+    DEBUG_s(DEBUG_v(PerlIO_printf(Perl_debug_log,
+            "MARK grow %p %"IVdf" by %"IVdf"\n",
+            PL_markstack_ptr, (IV)*PL_markstack_ptr, (IV)oldmax)));
     return PL_markstack_ptr;
 }
 

--
Perl5 Master Repository

Reply via email to