From 8789b556b369cfad91f322a2ad043890a20e5a80 Mon Sep 17 00:00:00 2001 From: Joe Watkins Date: Tue, 1 Aug 2017 05:52:15 +0100 Subject: [PATCH] Fixes #725: alloc non arena rt cache when rt is null in prepare function --- src/prepare.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prepare.c b/src/prepare.c index 9afb05ab..500eddcb 100644 --- a/src/prepare.c +++ b/src/prepare.c @@ -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);