]> granicus.if.org Git - php/commitdiff
fix a bug where PHP would enter in an infinite cycle with chars with ascii value...
authorNuno Lopes <nlopess@php.net>
Wed, 3 Jan 2007 22:02:43 +0000 (22:02 +0000)
committerNuno Lopes <nlopess@php.net>
Wed, 3 Jan 2007 22:02:43 +0000 (22:02 +0000)
while at it, remove the lim structure parameter (it wasn't being used)

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

index 8c2f0c6c84603e8968cb18ed90ad7afb250012fb..4355a97e68f37b0a82fb7fa2e772b3067341ce51 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.10.6 on Sat Dec  9 17:16:39 2007 */
+/* Generated by re2c 0.10.4 on Wed Jan  3 22:02:19 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);