Skip to content

Conversation

krakjoe
Copy link
Member

@krakjoe krakjoe commented Sep 14, 2013

resolve bug #65665, making the assumption we are just going to disable unsafe optimizations ...

@laruence
Copy link
Member

Hey:
thanks for spotting this, but I am afraid your fix is not right, I got another fix:


$ git diff
diff --git a/Optimizer/block_pass.c b/Optimizer/block_pass.c
index b8c3814..fd76322 100644
--- a/Optimizer/block_pass.c
+++ b/Optimizer/block_pass.c
@@ -1278,8 +1278,17 @@ static void assemble_code_blocks(zend_cfg *cfg, 
zend_op_array *op_array)
    if (op_array->last_try_catch) {
        int i;
        for (i = 0; i< op_array->last_try_catch; i++) {
-           op_array->try_catch_array[i].try_op = cfg->try[i]-
>start_opline - new_opcodes;
-           op_array->try_catch_array[i].catch_op = cfg->catch[i]-
>start_opline - new_opcodes;
+           if (cfg->try[i]->access) {
+               op_array->try_catch_array[i].try_op = cfg->try[i]-
>start_opline - new_opcodes;
+           } else {
+               op_array->try_catch_array[i].try_op = 0;
+           }
+
+           if (cfg->catch[i]->access) {
+               op_array->try_catch_array[i].catch_op = cfg-
>catch[i]->start_opline - new_opcodes;
+           } else {
+               op_array->try_catch_array[i].catch_op = 0;
+           }
        }
        efree(cfg->try);
        efree(cfg->catch);

@krakjoe
Copy link
Member Author

krakjoe commented Sep 15, 2013

Cool, so long as it gets fixed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants