Edit

kc3-lang/angle/src/compiler/preprocessor/64bit-tokenizer-safety.patch

Branch :

  • Show log

    Commit

  • Author : Jamie Madill
    Date : 2014-12-22 15:17:52
    Hash : 185de884
    Message : Update ANGLE's translator to Bison 3. BUG=angle:462 Change-Id: I2c1c18027dee1c3b4efb87374caaadbf58367841 Reviewed-on: https://chromium-review.googlesource.com/236930 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>

  • src/compiler/preprocessor/64bit-tokenizer-safety.patch
  • --- a/src/compiler/preprocessor/Tokenizer.cpp
    +++ b/src/compiler/preprocessor/Tokenizer.cpp
    @@ -56,6 +56,7 @@ typedef int16_t flex_int16_t;
     typedef uint16_t flex_uint16_t;
     typedef int32_t flex_int32_t;
     typedef uint32_t flex_uint32_t;
    +typedef uint64_t flex_uint64_t;
     #else
     typedef signed char flex_int8_t;
     typedef short int flex_int16_t;
    @@ -179,6 +180,11 @@ typedef void* yyscan_t;
     typedef struct yy_buffer_state *YY_BUFFER_STATE;
     #endif
    
    +#ifndef YY_TYPEDEF_YY_SIZE_T
    +#define YY_TYPEDEF_YY_SIZE_T
    +typedef size_t yy_size_t;
    +#endif
    +
     #define EOB_ACT_CONTINUE_SCAN 0
     #define EOB_ACT_END_OF_FILE 1
     #define EOB_ACT_LAST_MATCH 2
    @@ -353,7 +354,7 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
      */
     #define YY_DO_BEFORE_ACTION \
     	yyg->yytext_ptr = yy_bp; \
    -	yyleng = (size_t) (yy_cp - yy_bp); \
    +	yyleng = (yy_size_t) (yy_cp - yy_bp); \
     	yyg->yy_hold_char = *yy_cp; \
     	*yy_cp = '\0'; \
     	yyg->yy_c_buf_p = yy_cp;