Changeset 131
Legend:
- Unmodified
- Added
- Removed
-
trunk/utils.c
r121 r131 371 371 372 372 memcpy(&OG(included_files), &EG(included_files), sizeof(EG(included_files))); 373 memcpy(&OG(open_files), &CG(open_files), sizeof(CG(open_files)));374 373 375 374 #ifdef HAVE_XCACHE_CONSTANT … … 388 387 389 388 TG(included_files) = &EG(included_files); 390 TG(open_files) = &CG(open_files); 391 392 zend_llist_init(TG(open_files), sizeof(zend_file_handle), (void (*)(void *)) zend_file_handle_dtor, 0); 389 393 390 zend_hash_init_ex(TG(included_files), 5, NULL, NULL, 0, 1); 394 391 #ifdef HAVE_XCACHE_CONSTANT … … 440 437 i = 1; 441 438 zend_hash_add(&OG(included_files), sandbox->filename, strlen(sandbox->filename) + 1, (void *)&i, sizeof(int), NULL); 442 for (handle = zend_llist_get_first_ex(TG(open_files), &lpos);443 handle;444 handle = zend_llist_get_next_ex(TG(open_files), &lpos)) {445 zend_llist_add_element(&OG(open_files), handle);446 }447 439 } 448 440 /* }}} */ … … 466 458 TG(function_table).pDestructor = NULL; 467 459 TG(class_table).pDestructor = NULL; 468 TG(open_files)->dtor = NULL;469 460 } 470 461 … … 476 467 zend_hash_destroy(&TG(class_table)); 477 468 zend_hash_destroy(TG(included_files)); 478 zend_llist_destroy(TG(open_files));479 469 480 470 /* restore orig here, as EG/CG holded tmp before */ 481 471 memcpy(&EG(included_files), &OG(included_files), sizeof(EG(included_files))); 482 memcpy(&CG(open_files), &OG(open_files), sizeof(CG(open_files)));483 472 484 473 if (sandbox->alloc) { -
trunk/utils.h
r103 r131 38 38 39 39 HashTable orig_included_files; 40 zend_llist orig_open_files;41 40 HashTable *tmp_included_files; 42 zend_llist *tmp_open_files;43 41 44 42 #ifdef HAVE_XCACHE_CONSTANT -
trunk/xcache.c
r130 r131 559 559 i = 1; 560 560 zend_hash_add(&EG(included_files), xce->name.str.val, xce->name.str.len+1, (void *)&i, sizeof(int), NULL); 561 zend_llist_add_element(&CG(open_files), h); 561 if (h) { 562 zend_llist_add_element(&CG(open_files), h); 563 } 562 564 563 565 #ifndef ZEND_ENGINE_2 … … 939 941 940 942 if (xc_test && stored_xce) { 941 /* no install, keep open_files too for h*/943 /* free it, no install. restore now */ 942 944 xc_sandbox_free(&sandbox, 0 TSRMLS_CC); 943 sandbox.tmp_open_files->dtor = NULL;944 945 } 945 946 else { … … 956 957 destroy_op_array(op_array TSRMLS_CC); 957 958 efree(op_array); 959 h = NULL; 958 960 goto restore; 959 961 }

