case ZEND_DECLARE_ANON_CLASS:
ZEND_PASS_TWO_UPDATE_JMP_TARGET(op_array, opline, opline->op1);
break;
+ case ZEND_CATCH:
+ /* absolute index to relative offset */
+ opline->extended_value = ZEND_OPLINE_NUM_TO_OFFSET(op_array, opline, opline->extended_value);
+ break;
case ZEND_JMPZNZ:
/* absolute index to relative offset */
opline->extended_value = ZEND_OPLINE_NUM_TO_OFFSET(op_array, opline, opline->extended_value);
ZEND_VM_JMP(opline);
}
-ZEND_VM_HANDLER(45, ZEND_JMPZNZ, CONST|TMPVAR|CV, JMP_ADDR, JMP_REL)
+ZEND_VM_HANDLER(45, ZEND_JMPZNZ, CONST|TMPVAR|CV, JMP_ADDR, JMP_ADDR)
{
USE_OPLINE
zend_free_op free_op1;
HANDLE_EXCEPTION();
}
-ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV, JMP_ABS)
+ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV, JMP_ADDR)
{
USE_OPLINE
zend_class_entry *ce, *catch_ce;
/* Check whether an exception has been thrown, if not, jump over code */
zend_exception_restore();
if (EG(exception) == NULL) {
- ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->extended_value]);
- ZEND_VM_CONTINUE(); /* CHECK_ME */
+ ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value);
+ ZEND_VM_CONTINUE();
}
catch_ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
if (UNEXPECTED(catch_ce == NULL)) {
zend_throw_exception_internal(NULL);
HANDLE_EXCEPTION();
}
- ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->extended_value]);
- ZEND_VM_CONTINUE(); /* CHECK_ME */
+ ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value);
+ ZEND_VM_CONTINUE();
}
}
}
}
-ZEND_VM_HANDLER(78, ZEND_FE_FETCH_R, VAR, ANY, JMP_REL)
+ZEND_VM_HANDLER(78, ZEND_FE_FETCH_R, VAR, ANY, JMP_ADDR)
{
USE_OPLINE
zval *array;
ZEND_VM_NEXT_OPCODE();
}
-ZEND_VM_HANDLER(126, ZEND_FE_FETCH_RW, VAR, ANY, JMP_REL)
+ZEND_VM_HANDLER(126, ZEND_FE_FETCH_RW, VAR, ANY, JMP_ADDR)
{
USE_OPLINE
zval *array;
/* Check whether an exception has been thrown, if not, jump over code */
zend_exception_restore();
if (EG(exception) == NULL) {
- ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->extended_value]);
- ZEND_VM_CONTINUE(); /* CHECK_ME */
+ ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value);
+ ZEND_VM_CONTINUE();
}
catch_ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
if (UNEXPECTED(catch_ce == NULL)) {
zend_throw_exception_internal(NULL);
HANDLE_EXCEPTION();
}
- ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->extended_value]);
- ZEND_VM_CONTINUE(); /* CHECK_ME */
+ ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value);
+ ZEND_VM_CONTINUE();
}
}
"ZEND_VM_EXT_NUM" => 1<<16,
"ZEND_VM_EXT_VAR" => 1<<17,
- "ZEND_VM_EXT_JMP_ABS" => 1<<18,
- "ZEND_VM_EXT_JMP_REL" => 1<<19,
- "ZEND_VM_EXT_DIM_OBJ" => 1<<20,
- "ZEND_VM_EXT_CLASS_FETCH" => 1<<21,
- "ZEND_VM_EXT_CONST_FETCH" => 1<<22,
- "ZEND_VM_EXT_VAR_FETCH" => 1<<23,
- "ZEND_VM_EXT_ARRAY_INIT" => 1<<24,
- "ZEND_VM_EXT_TYPE" => 1<<25,
- "ZEND_VM_EXT_EVAL" => 1<<26,
- "ZEND_VM_EXT_FAST_CALL" => 1<<27,
- "ZEND_VM_EXT_FAST_RET" => 1<<28,
- "ZEND_VM_EXT_ISSET" => 1<<29,
+ "ZEND_VM_EXT_JMP_ADDR" => 1<<18,
+ "ZEND_VM_EXT_DIM_OBJ" => 1<<19,
+ "ZEND_VM_EXT_CLASS_FETCH" => 1<<20,
+ "ZEND_VM_EXT_CONST_FETCH" => 1<<21,
+ "ZEND_VM_EXT_VAR_FETCH" => 1<<22,
+ "ZEND_VM_EXT_ARRAY_INIT" => 1<<23,
+ "ZEND_VM_EXT_TYPE" => 1<<24,
+ "ZEND_VM_EXT_EVAL" => 1<<25,
+ "ZEND_VM_EXT_FAST_CALL" => 1<<26,
+ "ZEND_VM_EXT_FAST_RET" => 1<<27,
+ "ZEND_VM_EXT_ISSET" => 1<<28,
);
foreach ($vm_op_flags as $name => $val) {
$vm_ext_decode = array(
"NUM" => ZEND_VM_EXT_NUM,
"VAR" => ZEND_VM_EXT_VAR,
- "JMP_ABS" => ZEND_VM_EXT_JMP_ABS,
- "JMP_REL" => ZEND_VM_EXT_JMP_REL,
+ "JMP_ADDR" => ZEND_VM_EXT_JMP_ADDR,
"DIM_OBJ" => ZEND_VM_EXT_DIM_OBJ,
"CLASS_FETCH" => ZEND_VM_EXT_CLASS_FETCH,
"CONST_FETCH" => ZEND_VM_EXT_CONST_FETCH,
0x00000707,
0x00000707,
0x00000707,
- 0x02000003,
+ 0x01000003,
0x00000003,
- 0x00100701,
- 0x00100701,
- 0x00100701,
- 0x00100701,
- 0x00100701,
- 0x00100701,
- 0x00100701,
- 0x00100701,
- 0x00100701,
- 0x00100701,
- 0x00100701,
+ 0x00080701,
+ 0x00080701,
+ 0x00080701,
+ 0x00080701,
+ 0x00080701,
+ 0x00080701,
+ 0x00080701,
+ 0x00080701,
+ 0x00080701,
+ 0x00080701,
+ 0x00080701,
0x00000001,
0x00000001,
0x00000001,
0x00000010,
0x00001007,
0x00001007,
- 0x00081007,
+ 0x00041007,
0x00001007,
0x00001007,
0x00000707,
0x00011003,
0x00010300,
0x00000005,
- 0x01000703,
+ 0x00800703,
0x00010703,
- 0x04000007,
- 0x00800107,
+ 0x02000007,
+ 0x00400107,
0x00000701,
0x00000701,
0x00001003,
- 0x00080001,
+ 0x00040001,
0x00000007,
- 0x00800107,
+ 0x00400107,
0x00000707,
0x00000703,
- 0x00800107,
+ 0x00400107,
0x00000701,
0x00000701,
- 0x00800107,
+ 0x00400107,
0x00000701,
0x00000701,
- 0x00800107,
+ 0x00400107,
0x00000707,
0x00000707,
- 0x00800107,
+ 0x00400107,
0x00000703,
0x00000703,
- 0x00800107,
+ 0x00400107,
0x00000701,
0x00000701,
0x00000307,
- 0x00400301,
+ 0x00200301,
0x00000000,
0x00000000,
0x00000000,
0x00000801,
0x00040103,
0x00000003,
- 0x00200700,
+ 0x00100700,
0x00000007,
0x00000003,
0x00010707,
0x00010703,
- 0x20800107,
- 0x20000707,
+ 0x10400107,
+ 0x10000707,
0x00000803,
0x00000801,
0x00010703,
0x00000801,
0x00000007,
0x00000003,
- 0x02000003,
+ 0x01000003,
0x00000103,
0x00001003,
- 0x00080001,
+ 0x00040001,
0x00000005,
0x00010700,
0x00000000,
0x00020000,
0x00000000,
0x00000701,
- 0x20000707,
+ 0x10000707,
0x00000000,
0x00000000,
0x00001000,
0x00000000,
0x00000000,
0x00000101,
- 0x00200000,
+ 0x00100000,
0x00000000,
0x00000000,
0x00000303,
0x00000003,
- 0x08002010,
- 0x10002000,
+ 0x04002010,
+ 0x08002000,
0x00000008,
0x00000000,
0x00000707,
- 0x00100701,
+ 0x00080701,
0x00000301,
0x00001003,
0x00000707,
0x00000307,
0x00000307,
0x00000307,
- 0x20000307,
+ 0x10000307,
0x00000303,
};
#define ZEND_VM_OP2_JMP_ABS 0x00002000
#define ZEND_VM_EXT_NUM 0x00010000
#define ZEND_VM_EXT_VAR 0x00020000
-#define ZEND_VM_EXT_JMP_ABS 0x00040000
-#define ZEND_VM_EXT_JMP_REL 0x00080000
-#define ZEND_VM_EXT_DIM_OBJ 0x00100000
-#define ZEND_VM_EXT_CLASS_FETCH 0x00200000
-#define ZEND_VM_EXT_CONST_FETCH 0x00400000
-#define ZEND_VM_EXT_VAR_FETCH 0x00800000
-#define ZEND_VM_EXT_ARRAY_INIT 0x01000000
-#define ZEND_VM_EXT_TYPE 0x02000000
-#define ZEND_VM_EXT_EVAL 0x04000000
-#define ZEND_VM_EXT_FAST_CALL 0x08000000
-#define ZEND_VM_EXT_FAST_RET 0x10000000
-#define ZEND_VM_EXT_ISSET 0x20000000
+#define ZEND_VM_EXT_JMP_ADDR 0x00040000
+#define ZEND_VM_EXT_DIM_OBJ 0x00080000
+#define ZEND_VM_EXT_CLASS_FETCH 0x00100000
+#define ZEND_VM_EXT_CONST_FETCH 0x00200000
+#define ZEND_VM_EXT_VAR_FETCH 0x00400000
+#define ZEND_VM_EXT_ARRAY_INIT 0x00800000
+#define ZEND_VM_EXT_TYPE 0x01000000
+#define ZEND_VM_EXT_EVAL 0x02000000
+#define ZEND_VM_EXT_FAST_CALL 0x04000000
+#define ZEND_VM_EXT_FAST_RET 0x08000000
+#define ZEND_VM_EXT_ISSET 0x10000000
BEGIN_EXTERN_C()
case ZEND_DECLARE_ANON_INHERITED_CLASS:
ZEND_PASS_TWO_UNDO_JMP_TARGET(op_array, opline, ZEND_OP1(opline));
break;
+ case ZEND_CATCH:
+ /* relative offset into absolute index */
+ opline->extended_value = ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, opline->extended_value);
+ break;
case ZEND_JMPZNZ:
/* relative offset into absolute index */
opline->extended_value = ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, opline->extended_value);
case ZEND_DECLARE_ANON_INHERITED_CLASS:
ZEND_PASS_TWO_UPDATE_JMP_TARGET(op_array, opline, ZEND_OP1(opline));
break;
+ case ZEND_CATCH:
+ /* absolute index to relative offset */
+ opline->extended_value = ZEND_OPLINE_NUM_TO_OFFSET(op_array, opline, opline->extended_value);
+ break;
case ZEND_JMPZNZ:
/* absolute index to relative offset */
opline->extended_value = ZEND_OPLINE_NUM_TO_OFFSET(op_array, opline, opline->extended_value);