#define SET_UNUSED(op) op ## _type = IS_UNUSED
#define MAKE_NOP(opline) do { \
- opline->opcode = ZEND_NOP; \
- memset(&opline->result, 0, sizeof(opline->result)); \
- memset(&opline->op1, 0, sizeof(opline->op1)); \
- memset(&opline->op2, 0, sizeof(opline->op2)); \
- opline->result_type = opline->op1_type = opline->op2_type = IS_UNUSED; \
+ (opline)->op1.num = 0; \
+ (opline)->op2.num = 0; \
+ (opline)->result.num = 0; \
+ (opline)->opcode = ZEND_NOP; \
+ (opline)->op1_type = IS_UNUSED; \
+ (opline)->op2_type = IS_UNUSED; \
+ (opline)->result_type = IS_UNUSED; \
} while (0)
#define RESET_DOC_COMMENT() do { \
#undef MAKE_NOP
-#define MAKE_NOP(opline) do { \
+#define MAKE_NOP(opline) do { \
+ (opline)->op1.num = 0; \
+ (opline)->op2.num = 0; \
+ (opline)->result.num = 0; \
(opline)->opcode = ZEND_NOP; \
- memset(&(opline)->result, 0, sizeof((opline)->result)); \
- memset(&(opline)->op1, 0, sizeof((opline)->op1)); \
- memset(&(opline)->op2, 0, sizeof((opline)->op2)); \
- (opline)->result_type = (opline)->op1_type = (opline)->op2_type=IS_UNUSED; \
- zend_vm_set_opcode_handler(opline); \
-} while (0);
+ (opline)->op1_type = IS_UNUSED; \
+ (opline)->op2_type = IS_UNUSED; \
+ (opline)->result_type = IS_UNUSED; \
+ zend_vm_set_opcode_handler(opline); \
+} while (0)
+
#define RESULT_USED(op) (((op->result_type & IS_VAR) && !(op->result_type & EXT_TYPE_UNUSED)) || op->result_type == IS_TMP_VAR)
#define RESULT_UNUSED(op) ((op->result_type & EXT_TYPE_UNUSED) != 0)
#define SAME_VAR(op1, op2) ((((op1 ## _type & IS_VAR) && (op2 ## _type & IS_VAR)) || (op1 ## _type == IS_TMP_VAR && op2 ## _type == IS_TMP_VAR)) && op1.var == op2.var)