Hide __attribute__((unused)) behind PERL_UNUSED_DECL as
[p5sagit/p5-mst-13.2.git] / regexec.c
index b8659f2..da4513b 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -966,7 +966,8 @@ S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, char *sta
                else {
                    U8 *r = reghop3((U8*)s, -1, (U8*)startpos);
                
-                   tmp = (I32)utf8n_to_uvchr(r, s - (char*)r, 0, 0);
+                   if (s > (char*)r)
+                       tmp = (I32)utf8n_to_uvchr(r, s - (char*)r, 0, 0);
                }
                tmp = ((OP(c) == BOUND ?
                        isALNUM_uni(tmp) : isALNUM_LC_uvchr(UNI_TO_NATIVE(tmp))) != 0);
@@ -1009,7 +1010,8 @@ S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, char *sta
                else {
                    U8 *r = reghop3((U8*)s, -1, (U8*)startpos);
                
-                   tmp = (I32)utf8n_to_uvchr(r, s - (char*)r, 0, 0);
+                   if (s > (char*)r)
+                       tmp = (I32)utf8n_to_uvchr(r, s - (char*)r, 0, 0);
                }
                tmp = ((OP(c) == NBOUND ?
                        isALNUM_uni(tmp) : isALNUM_LC_uvchr(UNI_TO_NATIVE(tmp))) != 0);
@@ -3293,7 +3295,7 @@ S_regmatch(pTHX_ regnode *prog)
                }
                REGCP_SET(lastcp);
                if (paren) {
-                   UV c;
+                   UV c = 0;
                    while (n >= ln) {
                        if (c1 != -1000) {
                            if (do_utf8)
@@ -3313,7 +3315,7 @@ S_regmatch(pTHX_ regnode *prog)
                    }
                }
                else {
-                   UV c;
+                   UV c = 0;
                    while (n >= ln) {
                        if (c1 != -1000) {
                            if (do_utf8)