Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions TSRM/TSRM.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,10 @@ TSRM_API void tsrm_free_interpreter_context(void *context);
#define TSRMG(id, type, element) (((type) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(id)])->element)
#define TSRMLS_D void ***tsrm_ls
#define TSRMLS_DC , TSRMLS_D
#define TSRMLS_DN TSRMLS_D
#define TSRMLS_C tsrm_ls
#define TSRMLS_CC , TSRMLS_C
#define TSRMLS_CN TSRMLS_C

#ifdef __cplusplus
}
Expand All @@ -178,8 +180,10 @@ TSRM_API void tsrm_free_interpreter_context(void *context);
#define TSRMLS_SET_CTX(ctx)
#define TSRMLS_D void
#define TSRMLS_DC
#define TSRMLS_DN void ***tsrm_ls
#define TSRMLS_C
#define TSRMLS_CC
#define TSRMLS_CN NULL

#endif /* ZTS */

Expand Down
2 changes: 1 addition & 1 deletion Zend/acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ AC_DEFUN([LIBZEND_BISON_CHECK],[
# non-working versions, e.g. "3.0 3.2";
# remove "none" when introducing the first incompatible bison version an
# separate any following additions by spaces
bison_version_exclude="3.0"
bison_version_exclude="none"

# for standalone build of Zend Engine
test -z "$SED" && SED=sed
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend.c
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ void zend_set_utility_values(zend_utility_values *utility_values) /* {{{ */
/* }}} */

/* this should be compatible with the standard zenderror */
void zenderror(const char *error) /* {{{ */
void zenderror(TSRMLS_DN, const char *error) /* {{{ */
{
zend_error(E_PARSE, "%s", error);
}
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend.h
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ extern ZEND_API char *(*zend_resolve_path)(const char *filename, int filename_le

ZEND_API void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);

void zenderror(const char *error);
void zenderror(TSRMLS_DN, const char *error);

/* The following #define is used for code duality in PHP for Engine 1 & 2 */
#define ZEND_STANDARD_CLASS_DEF_PTR zend_standard_class_def
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -6837,7 +6837,7 @@ ZEND_API void zend_activate_auto_globals(TSRMLS_D) /* {{{ */
}
/* }}} */

int zendlex(znode *zendlval TSRMLS_DC) /* {{{ */
int zendlex(znode *zendlval, TSRMLS_DN) /* {{{ */
{
int retval;

Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_compile.h
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ ZEND_API zend_bool zend_is_auto_global(const char *name, uint name_len TSRMLS_DC
ZEND_API zend_bool zend_is_auto_global_quick(const char *name, uint name_len, ulong hashval TSRMLS_DC);
ZEND_API size_t zend_dirname(char *path, size_t len);

int zendlex(znode *zendlval TSRMLS_DC);
int zendlex(znode *zendlval, TSRMLS_DN);

int zend_add_literal(zend_op_array *op_array, const zval *zv TSRMLS_DC);

Expand Down
4 changes: 2 additions & 2 deletions Zend/zend_globals_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ BEGIN_EXTERN_C()
/* Compiler */
#ifdef ZTS
# define CG(v) TSRMG(compiler_globals_id, zend_compiler_globals *, v)
int zendparse(void *compiler_globals);
#else
# define CG(v) (compiler_globals.v)
extern ZEND_API struct _zend_compiler_globals compiler_globals;
int zendparse(void);
#endif

int zendparse(void *compiler_globals);


/* Executor */
#ifdef ZTS
Expand Down
19 changes: 8 additions & 11 deletions Zend/zend_ini_parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,9 @@
#include "zend_ini_scanner.h"
#include "zend_extensions.h"

#define YYERROR_VERBOSE
#define YYSTYPE zval

#ifdef ZTS
#define YYPARSE_PARAM tsrm_ls
#define YYLEX_PARAM tsrm_ls
int ini_parse(void *arg);
#else
int ini_parse(void);
#endif

#define ZEND_INI_PARSER_CB (CG(ini_parser_param))->ini_parser_cb
#define ZEND_INI_PARSER_ARG (CG(ini_parser_param))->arg
Expand Down Expand Up @@ -160,12 +153,11 @@ static void zend_ini_get_var(zval *result, zval *name TSRMLS_DC)

/* {{{ ini_error()
*/
static void ini_error(char *msg)
static void ini_error(TSRMLS_DN, char *msg)
{
char *error_buf;
int error_buf_len;
char *currently_parsed_filename;
TSRMLS_FETCH();

currently_parsed_filename = zend_ini_scanner_get_filename(TSRMLS_C);
if (currently_parsed_filename) {
Expand Down Expand Up @@ -206,7 +198,7 @@ ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_erro
}

CG(ini_parser_unbuffered_errors) = unbuffered_errors;
retval = ini_parse(TSRMLS_C);
retval = ini_parse(TSRMLS_CN);
zend_file_handle_dtor(fh TSRMLS_CC);

shutdown_ini_scanner(TSRMLS_C);
Expand Down Expand Up @@ -235,7 +227,7 @@ ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, int s
}

CG(ini_parser_unbuffered_errors) = unbuffered_errors;
retval = ini_parse(TSRMLS_C);
retval = ini_parse(TSRMLS_CN);

shutdown_ini_scanner(TSRMLS_C);

Expand All @@ -249,9 +241,14 @@ ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, int s

%}

%error-verbose

%expect 0
%pure_parser

%parse-param { void *tsrm_ls }
%lex-param { void *tsrm_ls }

%token TC_SECTION
%token TC_RAW
%token TC_CONSTANT
Expand Down
Loading