Changeset 330 for trunk/optimizer.c
- Timestamp:
- 2006-12-16T13:10:15+01:00 (6 years ago)
- File:
-
- 1 edited
-
trunk/optimizer.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/optimizer.c
r326 r330 225 225 #endif 226 226 227 #define bbs_get(bbs, n) ((bb_t *) xc_stack_get(bbs, n)) 228 #define bbs_count(bbs) xc_stack_count(bbs) 227 static bb_t *bbs_get(bbs_t *bbs, int n) /* {{{ */ 228 { 229 return (bb_t *) xc_stack_get(bbs, n); 230 } 231 /* }}} */ 232 static int bbs_count(bbs_t *bbs) /* {{{ */ 233 { 234 return xc_stack_count(bbs); 235 } 236 /* }}} */ 229 237 static void bbs_destroy(bbs_t *bbs) /* {{{ */ 230 238 { … … 398 406 } 399 407 /* }}} */ 400 static void bbs_restore_opnum(bbs_t *bbs ) /* {{{ */408 static void bbs_restore_opnum(bbs_t *bbs, zend_op_array *op_array) /* {{{ */ 401 409 { 402 410 int i; 411 bbid_t lasttrybbid; 412 403 413 for (i = 0; i < bbs_count(bbs); i ++) { 404 414 op_flowinfo_t fi; … … 422 432 } 423 433 424 /* TODO: rebuild zend_try_catch_element here */ 434 lasttrybbid = BBID_INVALID; 435 op_array->last_try_catch = 0; 436 for (i = 0; i < bbs_count(bbs); i ++) { 437 bb_t *bb = bbs_get(bbs, i); 438 439 if (lasttrybbid != bb->catch) { 440 if (lasttrybbid != BBID_INVALID) { 441 int try_catch_offset = op_array->last_try_catch ++; 442 443 op_array->try_catch_array = erealloc(op_array->try_catch_array, sizeof(zend_try_catch_element) * op_array->last_try_catch); 444 op_array->try_catch_array[try_catch_offset].try_op = bbs_get(bbs, lasttrybbid)->opnum; 445 op_array->try_catch_array[try_catch_offset].catch_op = bbs_get(bbs, bb->id)->opnum; 446 } 447 lasttrybbid = bb->catch; 448 } 449 } 450 /* it is impossible to have last bb catched */ 425 451 } 426 452 /* }}} */ … … 456 482 bb->opnum = bb->opcodes - op_array->opcodes; 457 483 } 458 bbs_restore_opnum(&bbs );484 bbs_restore_opnum(&bbs, op_array); 459 485 } 460 486 bbs_destroy(&bbs);
Note: See TracChangeset
for help on using the changeset viewer.

