Browse files

Get rid of an opcode

  • Loading branch information...
1 parent f41f62c commit 68fa4e50f8a3ba3fda5d661edeb453e5cf08ddc6 @zsuraski zsuraski committed Jul 30, 2003
Showing with 12 additions and 7 deletions.
  1. +4 −2 Zend/zend_compile.c
  2. +6 −2 Zend/zend_compile.h
  3. +2 −3 Zend/zend_execute.c
View
6 Zend/zend_compile.c
@@ -2901,10 +2901,12 @@ void zend_do_unset(znode *variable TSRMLS_DC)
last_op->opcode = ZEND_UNSET_VAR;
break;
case ZEND_FETCH_DIM_UNSET:
- last_op->opcode = ZEND_UNSET_DIM;
+ last_op->opcode = ZEND_UNSET_DIM_OBJ;
+ last_op->extended_value = ZEND_UNSET_DIM;
break;
case ZEND_FETCH_OBJ_UNSET:
- last_op->opcode = ZEND_UNSET_OBJ;
+ last_op->opcode = ZEND_UNSET_DIM_OBJ;
+ last_op->extended_value = ZEND_UNSET_OBJ;
break;
}
View
8 Zend/zend_compile.h
@@ -571,8 +571,7 @@ int zendlex(znode *zendlval TSRMLS_DC);
#define ZEND_INCLUDE_OR_EVAL 73
#define ZEND_UNSET_VAR 74
-#define ZEND_UNSET_DIM 75
-#define ZEND_UNSET_OBJ 76
+#define ZEND_UNSET_DIM_OBJ 75
#define ZEND_FE_RESET 77
#define ZEND_FE_FETCH 78
@@ -670,6 +669,11 @@ int zendlex(znode *zendlval TSRMLS_DC);
#define ZEND_FETCH_STATIC 2
#define ZEND_FETCH_STATIC_MEMBER 3
+
+/* obj/dim unsets */
+#define ZEND_UNSET_DIM 1
+#define ZEND_UNSET_OBJ 2
+
/* class fetches */
#define ZEND_FETCH_CLASS_DEFAULT 0
#define ZEND_FETCH_CLASS_SELF 1
View
5 Zend/zend_execute.c
@@ -3444,7 +3444,7 @@ int zend_unset_dim_obj_handler(ZEND_OPCODE_HANDLER_ARGS)
if (container) {
HashTable *ht;
- switch (EX(opline)->opcode) {
+ switch (EX(opline)->extended_value) {
case ZEND_UNSET_DIM:
switch (Z_TYPE_PP(container)) {
case IS_ARRAY:
@@ -4092,8 +4092,7 @@ void zend_init_opcodes_handlers()
zend_opcode_handlers[ZEND_INCLUDE_OR_EVAL] = zend_include_or_eval_handler;
zend_opcode_handlers[ZEND_UNSET_VAR] = zend_unset_var_handler;
- zend_opcode_handlers[ZEND_UNSET_DIM] = zend_unset_dim_obj_handler;
- zend_opcode_handlers[ZEND_UNSET_OBJ] = zend_unset_dim_obj_handler;
+ zend_opcode_handlers[ZEND_UNSET_DIM_OBJ] = zend_unset_dim_obj_handler;
zend_opcode_handlers[ZEND_FE_RESET] = zend_fe_reset_handler;
zend_opcode_handlers[ZEND_FE_FETCH] = zend_fe_fetch_handler;

0 comments on commit 68fa4e5

Please sign in to comment.