14
14
+----------------------------------------------------------------------+
15
15
*/
16
16
17
+ #include <stdint.h>
17
18
#ifdef HAVE_CONFIG_H
18
19
# include "config.h"
19
20
#endif
@@ -367,7 +368,6 @@ static ZEND_FUNCTION(zend_test_crash)
367
368
368
369
zend_mm_heap * zend_test_heap ;
369
370
zend_mm_heap * zend_orig_heap ;
370
- volatile uint32_t lineno = 0 ;
371
371
372
372
static bool has_opline (zend_execute_data * execute_data )
373
373
{
@@ -378,32 +378,29 @@ static bool has_opline(zend_execute_data *execute_data)
378
378
;
379
379
}
380
380
381
- #pragma GCC push_options
382
- #pragma GCC optimize("O0")
383
- void * __attribute__ ( (optnone )) zend_test_custom_malloc (size_t len )
381
+ void * zend_test_custom_malloc (size_t len )
384
382
{
385
383
if (has_opline (EG (current_execute_data ))) {
386
- lineno = EG (current_execute_data )-> opline -> lineno ;
384
+ assert ( EG (current_execute_data )-> opline -> lineno != ( uint32_t ) -1 ) ;
387
385
}
388
386
return _zend_mm_alloc (zend_orig_heap , len );
389
387
}
390
388
391
- void __attribute__(( optnone )) zend_test_custom_free (void * ptr )
389
+ void zend_test_custom_free (void * ptr )
392
390
{
393
391
if (has_opline (EG (current_execute_data ))) {
394
- lineno = EG (current_execute_data )-> opline -> lineno ;
392
+ assert ( EG (current_execute_data )-> opline -> lineno != ( uint32_t ) -1 ) ;
395
393
}
396
394
_zend_mm_free (zend_orig_heap , ptr );
397
395
}
398
396
399
- void * __attribute__ ( ( optnone )) zend_test_custom_realloc (void * ptr , size_t len )
397
+ void * zend_test_custom_realloc (void * ptr , size_t len )
400
398
{
401
399
if (has_opline (EG (current_execute_data ))) {
402
- lineno = EG (current_execute_data )-> opline -> lineno ;
400
+ assert ( EG (current_execute_data )-> opline -> lineno != ( uint32_t ) -1 ) ;
403
401
}
404
402
return _zend_mm_realloc (zend_orig_heap , ptr , len );
405
403
}
406
- #pragma GCC pop_options
407
404
408
405
static ZEND_FUNCTION (zend_test_observe_opline_in_zendmm )
409
406
{
0 commit comments