mirror of
https://github.com/php/php-src.git
synced 2026-04-07 08:02:49 +02:00
stop warnings from unused opcode map
This commit is contained in:
@@ -1202,8 +1202,8 @@ function gen_vm($def, $skel) {
|
||||
out($f, $GLOBALS['header_text']);
|
||||
|
||||
fputs($f, "#ifndef ZEND_VM_OPCODES_H\n#define ZEND_VM_OPCODES_H\n\n");
|
||||
fputs($f, "extern ZEND_API const char *zend_vm_opcodes_map[".($max_opcode + 1)."];\n\n");
|
||||
|
||||
fputs($f, "ZEND_API const char *zend_get_opcode_name(zend_uchar opcode);\n\n");
|
||||
|
||||
foreach ($opcodes as $code => $dsc) {
|
||||
$code = str_pad((string)$code,$code_len," ",STR_PAD_LEFT);
|
||||
$op = str_pad($dsc["op"],$max_opcode_len);
|
||||
@@ -1219,14 +1219,19 @@ function gen_vm($def, $skel) {
|
||||
|
||||
// Insert header
|
||||
out($f, $GLOBALS['header_text']);
|
||||
fputs($f,"#include <stdio.h>\n\n");
|
||||
|
||||
fputs($f,"#include <stdio.h>\n");
|
||||
fputs($f,"#include <zend.h>\n\n");
|
||||
|
||||
fputs($f,"const char *zend_vm_opcodes_map[".($max_opcode + 1)."] = {\n");
|
||||
for ($i = 0; $i <= $max_opcode; $i++) {
|
||||
fputs($f,"\t".(isset($opcodes[$i]["op"])?'"'.$opcodes[$i]["op"].'"':"NULL").",\n");
|
||||
}
|
||||
fputs($f, "};\n");
|
||||
|
||||
fputs($f, "};\n\n");
|
||||
|
||||
fputs($f, "ZEND_API const char* zend_get_opcode_name(zend_uchar opcode) {\n");
|
||||
fputs($f, "\treturn zend_vm_opcodes_map[opcode];\n");
|
||||
fputs($f, "}\n");
|
||||
|
||||
fclose($f);
|
||||
echo "zend_vm_opcodes.c generated successfully.\n";
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <zend.h>
|
||||
|
||||
const char *zend_vm_opcodes_map[159] = {
|
||||
"ZEND_NOP",
|
||||
@@ -181,3 +182,7 @@ const char *zend_vm_opcodes_map[159] = {
|
||||
"ZEND_QM_ASSIGN_VAR",
|
||||
"ZEND_JMP_SET_VAR",
|
||||
};
|
||||
|
||||
ZEND_API const char* zend_get_opcode_name(zend_uchar opcode) {
|
||||
return zend_vm_opcodes_map[opcode];
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#ifndef ZEND_VM_OPCODES_H
|
||||
#define ZEND_VM_OPCODES_H
|
||||
|
||||
extern ZEND_API const char *zend_vm_opcodes_map[159];
|
||||
ZEND_API const char *zend_get_opcode_name(zend_uchar opcode);
|
||||
|
||||
#define ZEND_NOP 0
|
||||
#define ZEND_ADD 1
|
||||
|
||||
Reference in New Issue
Block a user