Changeset 377 for eaccelerator/trunk/ea_dasm.c
- Timestamp:
- 01/20/10 15:58:03 (8 months ago)
- File:
-
- 1 edited
-
eaccelerator/trunk/ea_dasm.c (modified) (24 diffs)
Legend:
- Unmodified
- Added
- Removed
-
eaccelerator/trunk/ea_dasm.c
r375 r377 4 4 +----------------------------------------------------------------------+ 5 5 | Copyright (c) 2004 - 2010 eAccelerator | 6 | http://eaccelerator.net |6 | http://eaccelerator.net | 7 7 +----------------------------------------------------------------------+ 8 8 | This program is free software; you can redistribute it and/or | … … 39 39 /* {{{ static const char *extopnames_declare[] */ 40 40 static const char *extopnames_declare[] = { 41 "",/* 0 */42 "DECLARE_CLASS",/* 1 */43 "DECLARE_FUNCTION",/* 2 */44 "DECLARE_INHERITED_CLASS"/* 3 */41 "", /* 0 */ 42 "DECLARE_CLASS", /* 1 */ 43 "DECLARE_FUNCTION", /* 2 */ 44 "DECLARE_INHERITED_CLASS" /* 3 */ 45 45 }; 46 46 #define EXTOPNAMES_DECLARE_NUM 4 … … 50 50 /* {{{ static const char *extopnames_cast[] */ 51 51 static const char *extopnames_cast[] = { 52 "IS_NULL",/* 0 */53 "IS_LONG",/* 1 */54 "IS_DOUBLE",/* 2 */55 "IS_BOOL",/* 3 */56 "IS_ARRAY",/* 4 */57 "IS_OBJECT",/* 5 */58 "IS_STRING",/* 6 */59 "IS_RESOURCE",/* 7 */60 "IS_CONSTANT",/* 8 */61 "IS_CONSTANT_ARRAY"/* 9 */52 "IS_NULL", /* 0 */ 53 "IS_LONG", /* 1 */ 54 "IS_DOUBLE", /* 2 */ 55 "IS_BOOL", /* 3 */ 56 "IS_ARRAY", /* 4 */ 57 "IS_OBJECT", /* 5 */ 58 "IS_STRING", /* 6 */ 59 "IS_RESOURCE", /* 7 */ 60 "IS_CONSTANT", /* 8 */ 61 "IS_CONSTANT_ARRAY" /* 9 */ 62 62 }; 63 63 #define EXTOPNAMES_CAST_NUM 10 … … 67 67 /* {{{ static const char *extopnames_fetch[] */ 68 68 static const char *extopnames_fetch[] = { 69 "FETCH_STANDARD",/* 0 */70 "FETCH_ADD_LOCK",/* 1 */71 "FETCH_MAKE_REF"/* 2 */69 "FETCH_STANDARD", /* 0 */ 70 "FETCH_ADD_LOCK", /* 1 */ 71 "FETCH_MAKE_REF" /* 2 */ 72 72 }; 73 73 #define EXTOPNAMES_FETCH_NUM 2 … … 77 77 /* {{{ static const char *extopnames_fetch_class[] */ 78 78 static const char *extopnames_fetch_class[] = { 79 "FETCH_CLASS_DEFAULT",/* 0 */80 "FETCH_CLASS_SELF",/* 1 */81 "FETCH_CLASS_PARENT",/* 2 */82 "FETCH_CLASS_MAIN",/* 3 */83 "FETCH_CLASS_GLOBAL",/* 4 */84 "FETCH_CLASS_AUTO",/* 5 */85 "FETCH_CLASS_INTERFACE",/* 6 */86 "FETCH_CLASS_STATIC",/* 7 */79 "FETCH_CLASS_DEFAULT", /* 0 */ 80 "FETCH_CLASS_SELF", /* 1 */ 81 "FETCH_CLASS_PARENT", /* 2 */ 82 "FETCH_CLASS_MAIN", /* 3 */ 83 "FETCH_CLASS_GLOBAL", /* 4 */ 84 "FETCH_CLASS_AUTO", /* 5 */ 85 "FETCH_CLASS_INTERFACE", /* 6 */ 86 "FETCH_CLASS_STATIC", /* 7 */ 87 87 }; 88 88 #define EXTOPNAMES_FETCH_CLASS_NUM 6 … … 92 92 /* {{{ static const char *extopnames_init_fcall[] */ 93 93 static const char *extopnames_init_fcall[] = { 94 "",/* 0 */95 "MEMBER_FUNC_CALL",/* 1 */96 "CTOR_CALL",/* 2 */97 "CTOR_CALL"/* 3 */94 "", /* 0 */ 95 "MEMBER_FUNC_CALL", /* 1 */ 96 "CTOR_CALL", /* 2 */ 97 "CTOR_CALL" /* 3 */ 98 98 }; 99 99 #define EXTOPNAMES_INIT_FCALL_NUM 4 … … 103 103 /* {{{ static const char *extopnames_sendnoref[] */ 104 104 static const char *extopnames_sendnoref[] = { 105 " ",/* 0 */106 "ARG_SEND_BY_REF",/* 1 */107 "ARG_COMPILE_TIME_BOUND",/* 2 */108 "ARG_SEND_BY_REF | ZEND_ARG_COMPILE_TIME_BOUND"/* 3 */105 " ", /* 0 */ 106 "ARG_SEND_BY_REF", /* 1 */ 107 "ARG_COMPILE_TIME_BOUND", /* 2 */ 108 "ARG_SEND_BY_REF | ZEND_ARG_COMPILE_TIME_BOUND" /* 3 */ 109 109 }; 110 110 #define EXTOPNAMES_SENDNOREF_NUM 4 … … 114 114 /* {{{ static const char *fetchtypename[] */ 115 115 static const char *fetchtypename[] = { 116 "FETCH_GLOBAL",/* 0 */117 "FETCH_LOCAL",/* 1 */118 "FETCH_STATIC",/* 2 */119 "FETCH_STATIC_MEMBER",/* 3 */120 "FETCH_GLOBAL_LOCK",/* 4 */121 "FETCH_LEXICAL"/* 5 */116 "FETCH_GLOBAL", /* 0 */ 117 "FETCH_LOCAL", /* 1 */ 118 "FETCH_STATIC", /* 2 */ 119 "FETCH_STATIC_MEMBER", /* 3 */ 120 "FETCH_GLOBAL_LOCK", /* 4 */ 121 "FETCH_LEXICAL" /* 5 */ 122 122 }; 123 123 #define FETCHTYPENAME_NUM 5 … … 127 127 /* {{{ static const char *extopnames_fe[] */ 128 128 static const char *extopnames_fe[] = { 129 "",/* 0 */130 "FE_FETCH_BYREF",/* 1 */131 "FE_FETCH_WITH_KEY"/* 2 */129 "", /* 0 */ 130 "FE_FETCH_BYREF", /* 1 */ 131 "FE_FETCH_WITH_KEY" /* 2 */ 132 132 }; 133 133 #define EXTOPNAMES_FE_NUM 3 … … 204 204 * array() { [0] .. [n] => 205 205 * array () { 206 * [lineno]=> // the line number in the source code206 * [lineno] => // the line number in the source code 207 207 * [opcode] => // the opcode 208 208 * [extended_value]=> // the extended value field … … 235 235 array_init(el); 236 236 237 /* lineno */238 add_assoc_long(el, "lineno", opline->lineno);237 /* lineno */ 238 add_assoc_long(el, "lineno", opline->lineno); 239 239 240 240 /* opname */ … … 256 256 strncpy(buf, get_opcode_dsc(opline->extended_value)->opname, sizeof(buf)); 257 257 } else if ((op->ops & EXT_MASK) == EXT_CAST) { 258 const char *ptr = NULL;259 GET_EXTOPNAMES_CAST(opline->extended_value, ptr);258 const char *ptr = NULL; 259 GET_EXTOPNAMES_CAST(opline->extended_value, ptr); 260 260 strncpy(buf, ptr, sizeof(buf)); 261 261 } else if ((op->ops & EXT_MASK) == EXT_INIT_FCALL) { 262 const char *ptr = NULL;263 GET_EXTOPNAMES_INIT_FCALL(opline->extended_value, ptr);264 strncpy(buf, ptr, sizeof(buf));265 //snprintf(buf, sizeof(buf), "%d", opline->extended_value);262 const char *ptr = NULL; 263 GET_EXTOPNAMES_INIT_FCALL(opline->extended_value, ptr); 264 strncpy(buf, ptr, sizeof(buf)); 265 //snprintf(buf, sizeof(buf), "%d", opline->extended_value); 266 266 } else if ((op->ops & EXT_MASK) == EXT_FETCH) { 267 const char *ptr = NULL;268 GET_EXTOPNAMES_FETCH(opline->extended_value, ptr);267 const char *ptr = NULL; 268 GET_EXTOPNAMES_FETCH(opline->extended_value, ptr); 269 269 strncpy(buf, ptr, sizeof(buf)); 270 270 } else if ((op->ops & EXT_MASK) == EXT_FE) { 271 const char *ptr = NULL;272 GET_EXTOPNAMES_FE(opline->extended_value, ptr);271 const char *ptr = NULL; 272 GET_EXTOPNAMES_FE(opline->extended_value, ptr); 273 273 strncpy(buf, ptr, sizeof(buf)); 274 274 } else if ((op->ops & EXT_MASK) == EXT_DECLARE) { 275 const char *ptr = NULL;276 GET_EXTOPNAMES_DECLARE(opline->extended_value, ptr);275 const char *ptr = NULL; 276 GET_EXTOPNAMES_DECLARE(opline->extended_value, ptr); 277 277 strncpy(buf, ptr, sizeof(buf)); 278 278 } else if ((op->ops & EXT_MASK) == EXT_SEND_NOREF) { 279 const char *ptr = NULL;280 GET_EXTOPNAMES_SENDNOREF(opline->extended_value, ptr);279 const char *ptr = NULL; 280 GET_EXTOPNAMES_SENDNOREF(opline->extended_value, ptr); 281 281 strncpy(buf, ptr, sizeof(buf)); 282 282 } else if ((op->ops & EXT_MASK) == EXT_FCLASS) { 283 const char *ptr = NULL;284 GET_EXTOPNAMES_FETCH_CLASS(opline->extended_value, ptr);283 const char *ptr = NULL; 284 GET_EXTOPNAMES_FETCH_CLASS(opline->extended_value, ptr); 285 285 snprintf(buf, sizeof(buf), "%s", ptr); 286 286 } else if ((op->ops & EXT_MASK) == EXT_IFACE) { … … 300 300 snprintf(buf, sizeof(buf), "ZEND_ISEMPTY"); 301 301 } else { 302 buf[0] = '\0';302 buf[0] = '\0'; 303 303 } 304 304 } else if ((op->ops & EXT_MASK) == EXT_ASSIGN) { … … 308 308 snprintf(buf, sizeof(buf), "ZEND_ASSIGN_DIM"); 309 309 } else { 310 buf[0] = '\0';310 buf[0] = '\0'; 311 311 } 312 312 } else if (opline->extended_value != 0) { 313 313 snprintf(buf, sizeof(buf), "%ld", opline->extended_value); 314 314 } else { 315 buf[0] = '\0';315 buf[0] = '\0'; 316 316 } 317 317 add_assoc_string(el, "extended_value", buf, 1); … … 330 330 } else if ((op->ops & OP1_MASK) == OP1_UCLASS) { 331 331 if (opline->op1.op_type == IS_UNUSED) { 332 buf[0] = '\0';332 buf[0] = '\0'; 333 333 } else { 334 334 snprintf(buf, sizeof(buf), "$class%u", VAR_NUM(opline->op1.u.var)); … … 344 344 goto brk_failed; 345 345 } 346 jmp_to = &op_array->brk_cont_array[offset];346 jmp_to = &op_array->brk_cont_array[offset]; 347 347 offset = jmp_to->parent; 348 348 } while (--level > 0); … … 384 384 snprintf(buf, sizeof(buf), "$var%u", VAR_NUM(opline->op1.u.var)); 385 385 } else if (opline->op1.op_type == IS_UNUSED) { 386 buf[0] = '\0';386 buf[0] = '\0'; 387 387 } else { 388 388 snprintf(buf, sizeof(buf), "UNKNOWN NODE %d", opline->op1.op_type); … … 398 398 snprintf(buf, sizeof(buf), "$cv%u(%s)", opline->op2.u.var, op_array->vars[opline->op2.u.var].name); 399 399 } else if ((op->ops & OP2_MASK) == OP2_OPLINE) { 400 snprintf(buf, sizeof(buf), "opline(%d)", opline->op2.u.opline_num);401 } else if ((op->ops & OP2_MASK) == OP2_JMPADDR) {402 snprintf(buf, sizeof(buf), "opline(%u)", (unsigned int) (opline->op2.u.jmp_addr - op_array->opcodes));403 } else if ((op->ops & OP2_MASK) == OP2_CLASS) {404 snprintf(buf, sizeof(buf), "$class%u", VAR_NUM(opline->op2.u.var));405 } else if ((op->ops & OP2_MASK) == OP2_VAR) {406 snprintf(buf, sizeof(buf), "$var%u", VAR_NUM(opline->op2.u.var));407 } else if ((op->ops & OP2_MASK) == OP2_FETCH) {408 const char *typename = NULL;409 GET_FETCHTYPENAME(opline->op2.u.EA.type, typename);410 if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {411 snprintf(buf, sizeof(buf), "%s $class%u", typename, VAR_NUM(opline->op2.u.var));412 } else {413 snprintf(buf, sizeof(buf), "%s", typename);414 }415 } else if ((op->ops & OP2_MASK) == OP2_INCLUDE) {416 if (opline->op2.u.constant.value.lval == ZEND_EVAL) {417 snprintf(buf, sizeof(buf), "ZEND_EVAL");418 } else if (opline->op2.u.constant.value.lval == ZEND_INCLUDE) {400 snprintf(buf, sizeof(buf), "opline(%d)", opline->op2.u.opline_num); 401 } else if ((op->ops & OP2_MASK) == OP2_JMPADDR) { 402 snprintf(buf, sizeof(buf), "opline(%u)", (unsigned int) (opline->op2.u.jmp_addr - op_array->opcodes)); 403 } else if ((op->ops & OP2_MASK) == OP2_CLASS) { 404 snprintf(buf, sizeof(buf), "$class%u", VAR_NUM(opline->op2.u.var)); 405 } else if ((op->ops & OP2_MASK) == OP2_VAR) { 406 snprintf(buf, sizeof(buf), "$var%u", VAR_NUM(opline->op2.u.var)); 407 } else if ((op->ops & OP2_MASK) == OP2_FETCH) { 408 const char *typename = NULL; 409 GET_FETCHTYPENAME(opline->op2.u.EA.type, typename); 410 if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { 411 snprintf(buf, sizeof(buf), "%s $class%u", typename, VAR_NUM(opline->op2.u.var)); 412 } else { 413 snprintf(buf, sizeof(buf), "%s", typename); 414 } 415 } else if ((op->ops & OP2_MASK) == OP2_INCLUDE) { 416 if (opline->op2.u.constant.value.lval == ZEND_EVAL) { 417 snprintf(buf, sizeof(buf), "ZEND_EVAL"); 418 } else if (opline->op2.u.constant.value.lval == ZEND_INCLUDE) { 419 419 snprintf(buf, sizeof(buf), "ZEND_INCLUDE"); 420 } else if (opline->op2.u.constant.value.lval == ZEND_INCLUDE_ONCE) {421 snprintf(buf, sizeof(buf), "ZEND_INCLUDE_ONCE");422 } else if (opline->op2.u.constant.value.lval == ZEND_REQUIRE) {423 snprintf(buf, sizeof(buf), "ZEND_REQUIRE");424 } else if (opline->op2.u.constant.value.lval == ZEND_REQUIRE_ONCE) {425 snprintf(buf, sizeof(buf), "ZEND_REQUIRE_ONCE");426 } else {427 buf[0] = '\0';428 }429 } else if ((op->ops & OP2_MASK) == OP2_ARG) {430 snprintf(buf, sizeof(buf), "arg(%u)", opline->op2.u.opline_num);431 } else if ((op->ops & OP2_MASK) == OP2_ISSET) {432 if (opline->op2.u.constant.value.lval == ZEND_ISSET) {433 snprintf(buf, sizeof(buf), "ZEND_ISSET");434 } else if (opline->op2.u.constant.value.lval == ZEND_ISEMPTY) {435 snprintf(buf, sizeof(buf), "ZEND_ISEMPTY");436 } else {437 buf[0] = '\0';438 }439 } else {420 } else if (opline->op2.u.constant.value.lval == ZEND_INCLUDE_ONCE) { 421 snprintf(buf, sizeof(buf), "ZEND_INCLUDE_ONCE"); 422 } else if (opline->op2.u.constant.value.lval == ZEND_REQUIRE) { 423 snprintf(buf, sizeof(buf), "ZEND_REQUIRE"); 424 } else if (opline->op2.u.constant.value.lval == ZEND_REQUIRE_ONCE) { 425 snprintf(buf, sizeof(buf), "ZEND_REQUIRE_ONCE"); 426 } else { 427 buf[0] = '\0'; 428 } 429 } else if ((op->ops & OP2_MASK) == OP2_ARG) { 430 snprintf(buf, sizeof(buf), "arg(%u)", opline->op2.u.opline_num); 431 } else if ((op->ops & OP2_MASK) == OP2_ISSET) { 432 if (opline->op2.u.constant.value.lval == ZEND_ISSET) { 433 snprintf(buf, sizeof(buf), "ZEND_ISSET"); 434 } else if (opline->op2.u.constant.value.lval == ZEND_ISEMPTY) { 435 snprintf(buf, sizeof(buf), "ZEND_ISEMPTY"); 436 } else { 437 buf[0] = '\0'; 438 } 439 } else { 440 440 if (opline->op2.op_type == IS_CONST) { 441 441 zval_used = 1; 442 442 add_assoc_string(el, "op2", get_zval(&opline->op2.u.constant), 0); 443 443 } else if (opline->op2.op_type == IS_TMP_VAR) { 444 snprintf(buf, sizeof(buf), "$tmp%u", VAR_NUM(opline->op2.u.var));445 } else if (opline->op2.op_type == IS_VAR) {446 snprintf(buf, sizeof(buf), "$var%u", VAR_NUM(opline->op2.u.var));447 } else if (opline->op2.op_type == IS_UNUSED) {448 buf[0] = '\0';449 } else {450 snprintf(buf, sizeof(buf), "UNKNOWN NODE %d", opline->op2.op_type);451 }452 }444 snprintf(buf, sizeof(buf), "$tmp%u", VAR_NUM(opline->op2.u.var)); 445 } else if (opline->op2.op_type == IS_VAR) { 446 snprintf(buf, sizeof(buf), "$var%u", VAR_NUM(opline->op2.u.var)); 447 } else if (opline->op2.op_type == IS_UNUSED) { 448 buf[0] = '\0'; 449 } else { 450 snprintf(buf, sizeof(buf), "UNKNOWN NODE %d", opline->op2.op_type); 451 } 452 } 453 453 if (zval_used == 0) { 454 454 add_assoc_string(el, "op2", buf, 1); … … 460 460 snprintf(buf, sizeof(buf), "$cv%u(%s)", opline->result.u.var, op_array->vars[opline->result.u.var].name); 461 461 } else 462 switch (op->ops & RES_MASK) {463 case RES_STD:464 if (opline->result.op_type == IS_CONST) {462 switch (op->ops & RES_MASK) { 463 case RES_STD: 464 if (opline->result.op_type == IS_CONST) { 465 465 zval_used = 1; 466 466 add_assoc_string(el, "result", get_zval(&opline->result.u.constant), 0); 467 } else if (opline->result.op_type == IS_TMP_VAR) {468 snprintf(buf, sizeof(buf), "$tmp%u", VAR_NUM(opline->result.u.var));467 } else if (opline->result.op_type == IS_TMP_VAR) { 468 snprintf(buf, sizeof(buf), "$tmp%u", VAR_NUM(opline->result.u.var)); 469 469 } else if (opline->result.op_type == IS_VAR) { 470 if ((opline->result.u.EA.type & EXT_TYPE_UNUSED) != 0) {471 snprintf(buf, sizeof(buf), "$var%u (unused)", VAR_NUM(opline->result.u.var));470 if ((opline->result.u.EA.type & EXT_TYPE_UNUSED) != 0) { 471 snprintf(buf, sizeof(buf), "$var%u (unused)", VAR_NUM(opline->result.u.var)); 472 472 } else { 473 snprintf(buf, sizeof(buf), "$var%u", VAR_NUM(opline->result.u.var));473 snprintf(buf, sizeof(buf), "$var%u", VAR_NUM(opline->result.u.var)); 474 474 } 475 } else if (opline->result.op_type == IS_UNUSED) { 476 buf[0] = '\0'; 477 } else { 478 snprintf(buf, sizeof(buf), "UNKNOWN NODE %d", opline->result.op_type); 479 } 480 break; 481 case RES_CLASS: 482 snprintf(buf, sizeof(buf), "$class%u", VAR_NUM(opline->result.u.var)); 483 break; 484 case RES_TMP: 485 snprintf(buf, sizeof(buf), "$tmp%u", VAR_NUM(opline->result.u.var)); 486 break; 487 case RES_VAR: 488 if ((opline->result.u.EA.type & EXT_TYPE_UNUSED) != 0) { 489 snprintf(buf, sizeof(buf), "$var%u (unused)", VAR_NUM(opline->result.u.var)); 490 } else { 491 snprintf(buf, sizeof(buf), "$var%u", VAR_NUM(opline->result.u.var)); 492 } 493 break; 494 case RES_UNUSED: 495 buf[0] = '\0'; 496 break; 497 default: 498 snprintf(buf, sizeof(buf), "UNKNOWN NODE %d", opline->result.op_type); 499 break; 500 } 475 } else if (opline->result.op_type == IS_UNUSED) { 476 buf[0] = '\0'; 477 } else { 478 snprintf(buf, sizeof(buf), "UNKNOWN NODE %d", opline->result.op_type); 479 } 480 break; 481 case RES_CLASS: 482 snprintf(buf, sizeof(buf), "$class%u", VAR_NUM(opline->result.u.var)); 483 break; 484 case RES_TMP: 485 snprintf(buf, sizeof(buf), "$tmp%u", VAR_NUM(opline->result.u.var)); 486 break; 487 case RES_VAR: 488 if ((opline->result.u.EA.type & EXT_TYPE_UNUSED) != 0) { 489 snprintf(buf, sizeof(buf), "$var%u (unused)", VAR_NUM(opline->result.u.var)); 490 } else { 491 snprintf(buf, sizeof(buf), "$var%u", VAR_NUM(opline->result.u.var)); 492 } 493 break; 494 case RES_UNUSED: 495 buf[0] = '\0'; 496 break; 497 case RES_OPLINE: 498 snprintf(buf, sizeof(buf), "opline(%d)", opline->result.u.opline_num); 499 break; 500 default: 501 snprintf(buf, sizeof(buf), "UNKNOWN NODE %d", opline->result.op_type); 502 break; 503 } 501 504 if (zval_used == 0) { 502 505 add_assoc_string(el, "result", buf, 1); … … 516 519 ea_cache_entry *result = NULL; 517 520 518 if (file != NULL) {519 EACCELERATOR_UNPROTECT();520 EACCELERATOR_LOCK_RD();521 EACCELERATOR_PROTECT();522 for (slot = 0; slot < EA_HASH_SIZE; slot++) {523 p = ea_mm_instance->hash[slot];524 while (p != NULL) {525 if (strcmp(p->realfilename, file) == 0) {526 result = p;527 }528 p = p->next;529 }530 }531 EACCELERATOR_UNPROTECT();532 EACCELERATOR_UNLOCK_RD();533 EACCELERATOR_PROTECT();521 if (file != NULL) { 522 EACCELERATOR_UNPROTECT(); 523 EACCELERATOR_LOCK_RD(); 524 EACCELERATOR_PROTECT(); 525 for (slot = 0; slot < EA_HASH_SIZE; slot++) { 526 p = ea_mm_instance->hash[slot]; 527 while (p != NULL) { 528 if (strcmp(p->realfilename, file) == 0) { 529 result = p; 530 } 531 p = p->next; 532 } 533 } 534 EACCELERATOR_UNPROTECT(); 535 EACCELERATOR_UNLOCK_RD(); 536 EACCELERATOR_PROTECT(); 534 537 } 535 538 return result; … … 554 557 const char *file; 555 558 int file_len; 556 ea_cache_entry *p;559 ea_cache_entry *p; 557 560 ea_fc_entry *fc; 558 561 zval *functions; … … 560 563 561 564 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len) == FAILURE) 562 return;563 564 if (ea_mm_instance == NULL || php_check_open_basedir(file TSRMLS_CC)) {565 RETURN_NULL();566 }565 return; 566 567 if (ea_mm_instance == NULL || php_check_open_basedir(file TSRMLS_CC)) { 568 RETURN_NULL(); 569 } 567 570 568 571 p = get_cache_entry(file); … … 577 580 578 581 /* file functions */ 579 fc = p->f_head;582 fc = p->f_head; 580 583 MAKE_STD_ZVAL(functions); 581 584 array_init(functions); 582 while (fc != NULL) {585 while (fc != NULL) { 583 586 add_assoc_zval(functions, fc->htabkey, get_op_array((ea_op_array *)fc->fc TSRMLS_CC)); 584 fc = fc->next;585 }587 fc = fc->next; 588 } 586 589 add_assoc_zval(return_value, "functions", functions); 587 590 588 591 /* file classes */ 589 fc = p->c_head;592 fc = p->c_head; 590 593 MAKE_STD_ZVAL(classes); 591 594 array_init(classes); 592 if (fc != NULL) {593 while (fc != NULL) {594 ea_class_entry *c = (ea_class_entry *) fc->fc;595 if (fc != NULL) { 596 while (fc != NULL) { 597 ea_class_entry *c = (ea_class_entry *) fc->fc; 595 598 if (c->type == ZEND_USER_CLASS) { /* get methods */ 596 599 zval *methods; … … 610 613 } 611 614 fc = fc->next; 612 }613 }615 } 616 } 614 617 add_assoc_zval(return_value, "classes", classes); 615 618 }
Note: See TracChangeset
for help on using the changeset viewer.