Skip to content
This repository has been archived by the owner on Dec 16, 2019. It is now read-only.

Commit

Permalink
Fixes #725: alloc non arena rt cache when rt is null in prepare function
Browse files Browse the repository at this point in the history
  • Loading branch information
krakjoe committed Aug 1, 2017
1 parent 81d3cc0 commit 8789b55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/prepare.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ static inline int pthreads_prepared_entry_function_prepare(zval *bucket, int arg

/* runtime cache relies on immutable scope, so if scope changed, reallocate runtime cache */
/* IT WOULD BE NICE IF THIS WERE DOCUMENTED SOMEWHERE OTHER THAN PHP-SRC */
if (function->common.scope != scope) {
if (!function->op_array.run_time_cache || function->common.scope != scope) {
zend_op_array *op_array = &function->op_array;
op_array->run_time_cache = emalloc(op_array->cache_size);
memset(op_array->run_time_cache, 0, op_array->cache_size);
Expand Down

1 comment on commit 8789b55

@dktapps
Copy link
Contributor

@dktapps dktapps commented on 8789b55 Aug 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Please sign in to comment.