summaryrefslogtreecommitdiff
path: root/Zend/zend_language_scanner.l
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2014-04-30 20:28:02 +0200
committerNikita Popov <nikic@php.net>2014-05-01 09:08:29 +0200
commit5a03efe2790cc935d4d8ca723bd21ce8c079fbd4 (patch)
treed378f9fb31ab2bce4f70211df94b4403db55d5ca /Zend/zend_language_scanner.l
parent257bf697ae9b2ae366f7f3726019c18ad92b9002 (diff)
downloadphp-git-5a03efe2790cc935d4d8ca723bd21ce8c079fbd4.tar.gz
Don't allocate zend_stack elements individually
Instead allocate a vector of elements. Size must now be specified on initialization rather than on push.
Diffstat (limited to 'Zend/zend_language_scanner.l')
-rw-r--r--Zend/zend_language_scanner.l10
1 files changed, 5 insertions, 5 deletions
diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l
index 2204adf064..71e9bb60ab 100644
--- a/Zend/zend_language_scanner.l
+++ b/Zend/zend_language_scanner.l
@@ -152,7 +152,7 @@ internal_encoding, zend_multibyte_encoding_utf8 TSRMLS_CC);
static void _yy_push_state(int new_state TSRMLS_DC)
{
- zend_stack_push(&SCNG(state_stack), (void *) &YYGETCONDITION(), sizeof(int));
+ zend_stack_push(&SCNG(state_stack), (void *) &YYGETCONDITION());
YYSETCONDITION(new_state);
}
@@ -179,7 +179,7 @@ void startup_scanner(TSRMLS_D)
{
CG(parse_error) = 0;
CG(doc_comment) = NULL;
- zend_stack_init(&SCNG(state_stack));
+ zend_stack_init(&SCNG(state_stack), sizeof(int));
zend_ptr_stack_init(&SCNG(heredoc_label_stack));
}
@@ -206,7 +206,7 @@ ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
lex_state->yy_limit = SCNG(yy_limit);
lex_state->state_stack = SCNG(state_stack);
- zend_stack_init(&SCNG(state_stack));
+ zend_stack_init(&SCNG(state_stack), sizeof(int));
lex_state->heredoc_label_stack = SCNG(heredoc_label_stack);
zend_ptr_stack_init(&SCNG(heredoc_label_stack));
@@ -582,7 +582,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE TSRMLS_CC);
CG(in_compilation) = 1;
CG(active_op_array) = op_array;
- zend_stack_push(&CG(context_stack), (void *) &CG(context), sizeof(CG(context)));
+ zend_stack_push(&CG(context_stack), (void *) &CG(context));
zend_init_compiler_context(TSRMLS_C);
compiler_result = zendparse(TSRMLS_C);
zend_do_return(&retval_znode, 0 TSRMLS_CC);
@@ -748,7 +748,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE TSRMLS_CC);
CG(interactive) = orig_interactive;
CG(active_op_array) = op_array;
- zend_stack_push(&CG(context_stack), (void *) &CG(context), sizeof(CG(context)));
+ zend_stack_push(&CG(context_stack), (void *) &CG(context));
zend_init_compiler_context(TSRMLS_C);
BEGIN(ST_IN_SCRIPTING);
compiler_result = zendparse(TSRMLS_C);