gfx/angle/src/compiler/64bit-lexer-safety.patch

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 --- a/src/compiler/glslang_lex.cpp
michael@0 2 +++ b/src/compiler/glslang_lex.cpp
michael@0 3 @@ -68,6 +68,7 @@ typedef int16_t flex_int16_t;
michael@0 4 typedef uint16_t flex_uint16_t;
michael@0 5 typedef int32_t flex_int32_t;
michael@0 6 typedef uint32_t flex_uint32_t;
michael@0 7 +typedef uint64_t flex_uint64_t;
michael@0 8 #else
michael@0 9 typedef signed char flex_int8_t;
michael@0 10 typedef short int flex_int16_t;
michael@0 11 @@ -191,6 +192,11 @@ typedef void* yyscan_t;
michael@0 12 typedef struct yy_buffer_state *YY_BUFFER_STATE;
michael@0 13 #endif
michael@0 14
michael@0 15 +#ifndef YY_TYPEDEF_YY_SIZE_T
michael@0 16 +#define YY_TYPEDEF_YY_SIZE_T
michael@0 17 +typedef size_t yy_size_t;
michael@0 18 +#endif
michael@0 19 +
michael@0 20 #define EOB_ACT_CONTINUE_SCAN 0
michael@0 21 #define EOB_ACT_END_OF_FILE 1
michael@0 22 #define EOB_ACT_LAST_MATCH 2
michael@0 23 @@ -204,7 +210,7 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
michael@0 24 */
michael@0 25 #define YY_LESS_LINENO(n) \
michael@0 26 do { \
michael@0 27 - int yyl;\
michael@0 28 + yy_size_t yyl;\
michael@0 29 for ( yyl = n; yyl < yyleng; ++yyl )\
michael@0 30 if ( yytext[yyl] == '\n' )\
michael@0 31 --yylineno;\
michael@0 32 @@ -226,11 +232,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
michael@0 33
michael@0 34 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
michael@0 35
michael@0 36 -#ifndef YY_TYPEDEF_YY_SIZE_T
michael@0 37 -#define YY_TYPEDEF_YY_SIZE_T
michael@0 38 -typedef size_t yy_size_t;
michael@0 39 -#endif
michael@0 40 -
michael@0 41 #ifndef YY_STRUCT_YY_BUFFER_STATE
michael@0 42 #define YY_STRUCT_YY_BUFFER_STATE
michael@0 43 struct yy_buffer_state
michael@0 44 @@ -248,7 +249,7 @@ struct yy_buffer_state
michael@0 45 /* Number of characters read into yy_ch_buf, not including EOB
michael@0 46 * characters.
michael@0 47 */
michael@0 48 - int yy_n_chars;
michael@0 49 + yy_size_t yy_n_chars;
michael@0 50
michael@0 51 /* Whether we "own" the buffer - i.e., we know we created it,
michael@0 52 * and can realloc() it to grow it, and should free() it to
michael@0 53 @@ -327,7 +328,7 @@ static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
michael@0 54
michael@0 55 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
michael@0 56 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
michael@0 57 -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
michael@0 58 +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
michael@0 59
michael@0 60 void *yyalloc (yy_size_t ,yyscan_t yyscanner );
michael@0 61 void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
michael@0 62 @@ -378,7 +379,7 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
michael@0 63 */
michael@0 64 #define YY_DO_BEFORE_ACTION \
michael@0 65 yyg->yytext_ptr = yy_bp; \
michael@0 66 - yyleng = (size_t) (yy_cp - yy_bp); \
michael@0 67 + yyleng = (yy_size_t) (yy_cp - yy_bp); \
michael@0 68 yyg->yy_hold_char = *yy_cp; \
michael@0 69 *yy_cp = '\0'; \
michael@0 70 yyg->yy_c_buf_p = yy_cp;
michael@0 71 @@ -1035,8 +1036,8 @@ struct yyguts_t
michael@0 72 size_t yy_buffer_stack_max; /**< capacity of stack. */
michael@0 73 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
michael@0 74 char yy_hold_char;
michael@0 75 - int yy_n_chars;
michael@0 76 - int yyleng_r;
michael@0 77 + yy_size_t yy_n_chars;
michael@0 78 + yy_size_t yyleng_r;
michael@0 79 char *yy_c_buf_p;
michael@0 80 int yy_init;
michael@0 81 int yy_start;
michael@0 82 @@ -1089,7 +1090,7 @@ FILE *yyget_out (yyscan_t yyscanner );
michael@0 83
michael@0 84 void yyset_out (FILE * out_str ,yyscan_t yyscanner );
michael@0 85
michael@0 86 -int yyget_leng (yyscan_t yyscanner );
michael@0 87 +yy_size_t yyget_leng (yyscan_t yyscanner );
michael@0 88
michael@0 89 char *yyget_text (yyscan_t yyscanner );
michael@0 90
michael@0 91 @@ -1158,7 +1159,7 @@ static int input (yyscan_t yyscanner );
michael@0 92 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
michael@0 93 { \
michael@0 94 int c = '*'; \
michael@0 95 - int n; \
michael@0 96 + yy_size_t n; \
michael@0 97 for ( n = 0; n < max_size && \
michael@0 98 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
michael@0 99 buf[n] = (char) c; \
michael@0 100 @@ -1317,7 +1318,7 @@ yy_find_action:
michael@0 101
michael@0 102 if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
michael@0 103 {
michael@0 104 - int yyl;
michael@0 105 + yy_size_t yyl;
michael@0 106 for ( yyl = 0; yyl < yyleng; ++yyl )
michael@0 107 if ( yytext[yyl] == '\n' )
michael@0 108
michael@0 109 @@ -2203,7 +2204,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
michael@0 110
michael@0 111 else
michael@0 112 {
michael@0 113 - int num_to_read =
michael@0 114 + yy_size_t num_to_read =
michael@0 115 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
michael@0 116
michael@0 117 while ( num_to_read <= 0 )
michael@0 118 @@ -2217,7 +2218,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
michael@0 119
michael@0 120 if ( b->yy_is_our_buffer )
michael@0 121 {
michael@0 122 - int new_size = b->yy_buf_size * 2;
michael@0 123 + yy_size_t new_size = b->yy_buf_size * 2;
michael@0 124
michael@0 125 if ( new_size <= 0 )
michael@0 126 b->yy_buf_size += b->yy_buf_size / 8;
michael@0 127 @@ -2248,7 +2249,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
michael@0 128
michael@0 129 /* Read in more data. */
michael@0 130 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
michael@0 131 - yyg->yy_n_chars, (size_t) num_to_read );
michael@0 132 + yyg->yy_n_chars, num_to_read );
michael@0 133
michael@0 134 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
michael@0 135 }
michael@0 136 @@ -2373,7 +2374,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
michael@0 137
michael@0 138 else
michael@0 139 { /* need more input */
michael@0 140 - int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
michael@0 141 + yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
michael@0 142 ++yyg->yy_c_buf_p;
michael@0 143
michael@0 144 switch ( yy_get_next_buffer( yyscanner ) )
michael@0 145 @@ -2660,7 +2661,7 @@ void yypop_buffer_state (yyscan_t yyscanner)
michael@0 146 */
michael@0 147 static void yyensure_buffer_stack (yyscan_t yyscanner)
michael@0 148 {
michael@0 149 - int num_to_alloc;
michael@0 150 + yy_size_t num_to_alloc;
michael@0 151 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
michael@0 152
michael@0 153 if (!yyg->yy_buffer_stack) {
michael@0 154 @@ -2758,12 +2759,11 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
michael@0 155 * @param yyscanner The scanner object.
michael@0 156 * @return the newly allocated buffer state object.
michael@0 157 */
michael@0 158 -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
michael@0 159 +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner)
michael@0 160 {
michael@0 161 YY_BUFFER_STATE b;
michael@0 162 char *buf;
michael@0 163 - yy_size_t n;
michael@0 164 - int i;
michael@0 165 + yy_size_t n, i;
michael@0 166
michael@0 167 /* Get memory for full buffer, including space for trailing EOB's. */
michael@0 168 n = _yybytes_len + 2;
michael@0 169 @@ -2913,7 +2913,7 @@ FILE *yyget_out (yyscan_t yyscanner)
michael@0 170 /** Get the length of the current token.
michael@0 171 * @param yyscanner The scanner object.
michael@0 172 */
michael@0 173 -int yyget_leng (yyscan_t yyscanner)
michael@0 174 +yy_size_t yyget_leng (yyscan_t yyscanner)
michael@0 175 {
michael@0 176 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
michael@0 177 return yyleng;

mercurial