]> granicus.if.org Git - php/commitdiff
MFH: fix infinite cycle
authorNuno Lopes <nlopess@php.net>
Wed, 3 Jan 2007 22:05:24 +0000 (22:05 +0000)
committerNuno Lopes <nlopess@php.net>
Wed, 3 Jan 2007 22:05:24 +0000 (22:05 +0000)
#this was the infinite cycle that was bugging me in the gcov machine...

ext/pdo/pdo_sql_parser.c
ext/pdo/pdo_sql_parser.re

index c41513ceb699eb8e90f9d9e8766b971bcf6c0a2a..492fd62c7b71cb5035513c4cee0bd575714c3014 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.10.6 on Mon Dec  4 16:21:45 2006 */
+/* Generated by re2c 0.10.4 on Wed Jan  3 22:04:03 2007 */
 #line 1 "ext/pdo/pdo_sql_parser.re"
 /*
   +----------------------------------------------------------------------+
 
 #define RET(i) {s->cur = cursor; return i; }
 
-#define YYCTYPE         char
+#define YYCTYPE         unsigned char
 #define YYCURSOR        cursor
-#define YYLIMIT         s->lim
+#define YYLIMIT         cursor
 #define YYMARKER        s->ptr
 #define YYFILL(n)
 
 typedef struct Scanner {
-       char    *lim, *ptr, *cur, *tok;
+       char    *ptr, *cur, *tok;
 } Scanner;
 
 static int scan(Scanner *s) 
@@ -263,7 +263,6 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
 
        ptr = *outquery;
        s.cur = inquery;
-       s.lim = inquery + inquery_len;
 
        /* phase 1: look for args */
        while((t = scan(&s)) != PDO_PARSER_EOI) {
@@ -578,7 +577,6 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char
 
        ptr = *outquery;
        s.cur = inquery;
-       s.lim = inquery + inquery_len;
        while((t = scan(&s)) != PDO_PARSER_EOI) {
                if(t == PDO_PARSER_TEXT) {
                        memcpy(ptr, s.tok, s.cur - s.tok);
index 9bb5cc0bf496a1b5c9ae54642d6bf6a69d90ff8e..c5c8cbaaf44ed3a159bb62962632fd4f3cb13532 100644 (file)
@@ -2,7 +2,7 @@
   +----------------------------------------------------------------------+
   | PHP Version 5                                                        |
   +----------------------------------------------------------------------+
-  | Copyright (c) 1997-2006 The PHP Group                                |
+  | Copyright (c) 1997-2007 The PHP Group                                |
   +----------------------------------------------------------------------+
   | This source file is subject to version 3.01 of the PHP license,      |
   | that is bundled with this package in the file LICENSE, and is        |
 
 #define RET(i) {s->cur = cursor; return i; }
 
-#define YYCTYPE         char
+#define YYCTYPE         unsigned char
 #define YYCURSOR        cursor
-#define YYLIMIT         s->lim
+#define YYLIMIT         cursor
 #define YYMARKER        s->ptr
 #define YYFILL(n)
 
 typedef struct Scanner {
-       char    *lim, *ptr, *cur, *tok;
+       char    *ptr, *cur, *tok;
 } Scanner;
 
 static int scan(Scanner *s) 
@@ -90,7 +90,6 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
 
        ptr = *outquery;
        s.cur = inquery;
-       s.lim = inquery + inquery_len;
 
        /* phase 1: look for args */
        while((t = scan(&s)) != PDO_PARSER_EOI) {
@@ -405,7 +404,6 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char
 
        ptr = *outquery;
        s.cur = inquery;
-       s.lim = inquery + inquery_len;
        while((t = scan(&s)) != PDO_PARSER_EOI) {
                if(t == PDO_PARSER_TEXT) {
                        memcpy(ptr, s.tok, s.cur - s.tok);