summaryrefslogtreecommitdiffstats
path: root/php-bug77287.patch
blob: 4df20d6782ed90b194474f7ea6f9710c19e67410 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From 76760901fabf8ff53c8dfb4ddf7ca703c5a12b79 Mon Sep 17 00:00:00 2001
From: Nikita Popov <nikita.ppv@gmail.com>
Date: Tue, 22 Jan 2019 12:15:06 +0100
Subject: [PATCH] Fixed bug #77287

There may be an EXT_NOP opcode before the parameter list, we should
skip over it.
---
 NEWS                                     | 2 ++
 ext/opcache/Optimizer/compact_literals.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 6265b1736c6d..656e4ab70eaa 100644
--- a/NEWS
+++ b/NEWS
@@ -61,6 +61,8 @@ PHP                                                                        NEWS
     (Nikita)
   . Fixed bug #77361 (configure fails on 64-bit AIX when opcache enabled).
     (Kevin Adler)
+  . Fixed bug #77287 (Opcache literal compaction is incompatible with EXT
+    opcodes). (Nikita)
 
 - PCRE:
   . Fixed bug #77338 (get_browser with empty string). (Nikita)
diff --git a/ext/opcache/Optimizer/compact_literals.c b/ext/opcache/Optimizer/compact_literals.c
index 10bdf540118e..fdab0068a4d5 100644
--- a/ext/opcache/Optimizer/compact_literals.c
+++ b/ext/opcache/Optimizer/compact_literals.c
@@ -810,7 +810,7 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx
 						Z_CACHE_SLOT_P(val) = op_array->cache_size;
 						op_array->cache_size += sizeof(zval);
 					}
-				} else if (opline->opcode != ZEND_RECV) {
+				} else if (opline->opcode != ZEND_RECV && opline->opcode != ZEND_EXT_NOP) {
 					break;
 				}
 				opline++;