This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In Perl_re_op_compile, make a var volatile
authorDavid Mitchell <davem@iabyn.com>
Wed, 19 Oct 2011 10:49:40 +0000 (11:49 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 13 Jun 2012 12:25:50 +0000 (13:25 +0100)
This function includes a setjmp to allow for abort and retry if the
pattern getting compiled suddenly becomes UTF8. My recent changes to
it left one var generating the dreaded "warning: variable ‘pat’ might be
clobbered" warning. So declare it VOL to fix this.

regcomp.c

index c9e5aac..9449288 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -5030,7 +5030,7 @@ Perl_re_op_compile(pTHX_ SV * const pattern, OP *expr, U32 orig_pm_flags)
     I32 flags;
     I32 minlen = 0;
     U32 pm_flags;
-    SV *pat;
+    SV * VOL pat;
 
     /* these are all flags - maybe they should be turned
      * into a single int with different bit masks */