Skip to content

Commit 247ec0d

Browse files
committed
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: stop warnings from unused opcode map - BFN
2 parents 8e36d36 + b1df00a commit 247ec0d

File tree

6 files changed

+24
-10
lines changed

6 files changed

+24
-10
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ PHP NEWS
3030
- GD:
3131
. Fixed bug #64405 (Use freetype-config for determining freetype2 dir(s)).
3232
(Adam)
33+
34+
- PDO_odbc:
35+
. Fixed bug #66311 (Stack smashing protection kills PDO/ODBC queries).
36+
(michael at orlitzky dot com)
3337

3438
- MySQLi:
3539
. Fixed bug #65486 (mysqli_poll() is broken on win x64). (Anatol)

Zend/zend_language_scanner.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by re2c 0.13.5 */
1+
/* Generated by re2c 0.13.5 on Sun Dec 22 13:03:33 2013 */
22
#line 1 "Zend/zend_language_scanner.l"
33
/*
44
+----------------------------------------------------------------------+

Zend/zend_language_scanner_defs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by re2c 0.13.5 */
1+
/* Generated by re2c 0.13.5 on Sun Dec 22 13:03:33 2013 */
22
#line 3 "Zend/zend_language_scanner_defs.h"
33

44
enum YYCONDTYPE {

Zend/zend_vm_gen.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,8 +1181,8 @@ function gen_vm($def, $skel) {
11811181
out($f, $GLOBALS['header_text']);
11821182

11831183
fputs($f, "#ifndef ZEND_VM_OPCODES_H\n#define ZEND_VM_OPCODES_H\n\n");
1184-
fputs($f, "extern ZEND_API const char *zend_vm_opcodes_map[".($max_opcode + 1)."];\n\n");
1185-
1184+
fputs($f, "ZEND_API const char *zend_get_opcode_name(zend_uchar opcode);\n\n");
1185+
11861186
foreach ($opcodes as $code => $dsc) {
11871187
$code = str_pad((string)$code,$code_len," ",STR_PAD_LEFT);
11881188
$op = str_pad($dsc["op"],$max_opcode_len);
@@ -1198,14 +1198,19 @@ function gen_vm($def, $skel) {
11981198

11991199
// Insert header
12001200
out($f, $GLOBALS['header_text']);
1201-
fputs($f,"#include <stdio.h>\n\n");
1202-
1201+
fputs($f,"#include <stdio.h>\n");
1202+
fputs($f,"#include <zend.h>\n\n");
1203+
12031204
fputs($f,"const char *zend_vm_opcodes_map[".($max_opcode + 1)."] = {\n");
12041205
for ($i = 0; $i <= $max_opcode; $i++) {
12051206
fputs($f,"\t".(isset($opcodes[$i]["op"])?'"'.$opcodes[$i]["op"].'"':"NULL").",\n");
12061207
}
1207-
fputs($f, "};\n");
1208-
1208+
fputs($f, "};\n\n");
1209+
1210+
fputs($f, "ZEND_API const char* zend_get_opcode_name(zend_uchar opcode) {\n");
1211+
fputs($f, "\treturn zend_vm_opcodes_map[opcode];\n");
1212+
fputs($f, "}\n");
1213+
12091214
fclose($f);
12101215
echo "zend_vm_opcodes.c generated successfully.\n";
12111216

Zend/zend_vm_opcodes.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
*/
2020

2121
#include <stdio.h>
22+
#include <zend.h>
2223

2324
const char *zend_vm_opcodes_map[164] = {
2425
"ZEND_NOP",
@@ -186,3 +187,7 @@ const char *zend_vm_opcodes_map[164] = {
186187
"ZEND_FAST_CALL",
187188
"ZEND_FAST_RET",
188189
};
190+
191+
ZEND_API const char* zend_get_opcode_name(zend_uchar opcode) {
192+
return zend_vm_opcodes_map[opcode];
193+
}

Zend/zend_vm_opcodes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#ifndef ZEND_VM_OPCODES_H
2222
#define ZEND_VM_OPCODES_H
2323

24-
extern ZEND_API const char *zend_vm_opcodes_map[164];
24+
ZEND_API const char *zend_get_opcode_name(zend_uchar opcode);
2525

2626
#define ZEND_NOP 0
2727
#define ZEND_ADD 1
@@ -170,4 +170,4 @@ extern ZEND_API const char *zend_vm_opcodes_map[164];
170170
#define ZEND_FAST_CALL 162
171171
#define ZEND_FAST_RET 163
172172

173-
#endif
173+
#endif

0 commit comments

Comments
 (0)