@@ -280,7 +280,7 @@ static zend_string *make_str(unsigned char *text, size_t leng, HashTable *intern
280
280
}
281
281
282
282
static void add_token (
283
- zval * return_value , int token_type , unsigned char * text , size_t leng , int lineno ,
283
+ HashTable * return_value_ht , int token_type , unsigned char * text , size_t leng , int lineno ,
284
284
zend_class_entry * token_class , HashTable * interned_strings ) {
285
285
zval token ;
286
286
if (token_class ) {
@@ -315,7 +315,7 @@ static void add_token(
315
315
} else {
316
316
ZVAL_STR (& token , make_str (text , leng , interned_strings ));
317
317
}
318
- zend_hash_next_index_insert_new (Z_ARRVAL_P ( return_value ) , & token );
318
+ zend_hash_next_index_insert_new (return_value_ht , & token );
319
319
}
320
320
321
321
static bool tokenize (zval * return_value , zend_string * source , zend_class_entry * token_class )
@@ -337,11 +337,13 @@ static bool tokenize(zval *return_value, zend_string *source, zend_class_entry *
337
337
zend_hash_init (& interned_strings , 0 , NULL , NULL , 0 );
338
338
array_init (return_value );
339
339
340
+ HashTable * return_value_ht = Z_ARRVAL_P (return_value );
341
+
340
342
while ((token_type = lex_scan (& token , NULL ))) {
341
343
ZEND_ASSERT (token_type != T_ERROR );
342
344
343
345
add_token (
344
- return_value , token_type , zendtext , zendleng , token_line ,
346
+ return_value_ht , token_type , zendtext , zendleng , token_line ,
345
347
token_class , & interned_strings );
346
348
347
349
if (Z_TYPE (token ) != IS_UNDEF ) {
@@ -358,7 +360,7 @@ static bool tokenize(zval *return_value, zend_string *source, zend_class_entry *
358
360
/* fetch the rest into a T_INLINE_HTML */
359
361
if (zendcursor < zendlimit ) {
360
362
add_token (
361
- return_value , T_INLINE_HTML , zendcursor , zendlimit - zendcursor ,
363
+ return_value_ht , T_INLINE_HTML , zendcursor , zendlimit - zendcursor ,
362
364
token_line , token_class , & interned_strings );
363
365
}
364
366
break ;
@@ -383,7 +385,7 @@ static bool tokenize(zval *return_value, zend_string *source, zend_class_entry *
383
385
}
384
386
385
387
struct event_context {
386
- zval * tokens ;
388
+ HashTable * tokens ;
387
389
zend_class_entry * token_class ;
388
390
};
389
391
@@ -428,7 +430,7 @@ static void on_event(
428
430
ctx -> tokens , token , (unsigned char * ) text , length , line , ctx -> token_class , NULL );
429
431
break ;
430
432
case ON_FEEDBACK : {
431
- HashTable * tokens_ht = Z_ARRVAL_P ( ctx -> tokens ) ;
433
+ HashTable * tokens_ht = ctx -> tokens ;
432
434
zval * token_zv , * id_zv = NULL ;
433
435
ZEND_HASH_REVERSE_FOREACH_VAL (tokens_ht , token_zv ) {
434
436
id_zv = extract_token_id_to_replace (token_zv , text , length );
@@ -469,7 +471,7 @@ static bool tokenize_parse(
469
471
zend_prepare_string_for_scanning (& source_zval , ZSTR_EMPTY_ALLOC ());
470
472
array_init (& token_stream );
471
473
472
- ctx .tokens = & token_stream ;
474
+ ctx .tokens = Z_ARRVAL ( token_stream ) ;
473
475
ctx .token_class = token_class ;
474
476
475
477
CG (ast ) = NULL ;
0 commit comments