Changeset 214 for trunk/utils.c
- Timestamp:
- 2006-10-05T02:37:39+02:00 (7 years ago)
- File:
-
- 1 edited
-
trunk/utils.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/utils.c
r213 r214 319 319 } 320 320 /* }}} */ 321 int xc_do_early_binding(zend_op_array *op_array, HashTable *class_table, int oplineno TSRMLS_DC) /* {{{ */321 static int xc_do_early_binding(zend_op_array *op_array, HashTable *class_table, int oplineno TSRMLS_DC) /* {{{ */ 322 322 { 323 323 zend_op *opline, *opcodes; … … 337 337 zval *parent_name; 338 338 zend_class_entry **pce; 339 340 /* don't early-bind classes that implement interfaces */ 341 if ((opline + 1)->opcode == ZEND_FETCH_CLASS && (opline + 2)->opcode == ZEND_ADD_INTERFACE) { 342 return FAILURE; 343 } 344 339 345 parent_name = &(opline - 1)->op2.u.constant; 340 # ifdef DEBUG346 # ifdef DEBUG 341 347 fprintf(stderr, "binding with parent %s\n", Z_STRVAL_P(parent_name)); 342 # endif348 # endif 343 349 if (zend_lookup_class(Z_STRVAL_P(parent_name), Z_STRLEN_P(parent_name), &pce TSRMLS_CC) == FAILURE) { 344 350 return FAILURE; … … 349 355 } 350 356 } 351 #else 352 if (do_bind_function_or_class(opline, NULL, class_table, 1) == FAILURE) { 353 return FAILURE; 354 } 355 #endif 356 357 #ifdef ZEND_FETCH_CLASS 357 358 358 /* clear unnecessary ZEND_FETCH_CLASS opcode */ 359 359 if (opline > op_array->opcodes … … 361 361 zend_op *fetch_class_opline = opline - 1; 362 362 363 # ifdef DEBUG363 # ifdef DEBUG 364 364 fprintf(stderr, "%s %p\n", Z_STRVAL(fetch_class_opline->op2.u.constant), Z_STRVAL(fetch_class_opline->op2.u.constant)); 365 # endif365 # endif 366 366 OP_ZVAL_DTOR(fetch_class_opline->op2); 367 367 fetch_class_opline->opcode = ZEND_NOP; … … 372 372 SET_UNUSED(fetch_class_opline->op2); 373 373 SET_UNUSED(fetch_class_opline->result); 374 } 375 376 /* clear unnecessary ZEND_VERIFY_ABSTRACT_CLASS opcode */ 377 if ((opline + 1)->opcode == ZEND_VERIFY_ABSTRACT_CLASS) { 378 zend_op *abstract_op = opline + 1; 379 memset(abstract_op, 0, sizeof(abstract_op[0])); 380 abstract_op->lineno = 0; 381 SET_UNUSED(abstract_op->op1); 382 SET_UNUSED(abstract_op->op2); 383 SET_UNUSED(abstract_op->result); 384 abstract_op->opcode = ZEND_NOP; 385 ZEND_VM_SET_OPCODE_HANDLER(abstract_op); 386 } 387 #else 388 if (do_bind_function_or_class(opline, NULL, class_table, 1) == FAILURE) { 389 return FAILURE; 374 390 } 375 391 #endif
Note: See TracChangeset
for help on using the changeset viewer.

