Skip to content

disable unsafe optimization - #450

Closed
krakjoe wants to merge 1 commit into
php:masterfrom
krakjoe:opcache_bug_65665
Closed

disable unsafe optimization#450
krakjoe wants to merge 1 commit into
php:masterfrom
krakjoe:opcache_bug_65665

Conversation

@krakjoe

@krakjoe krakjoe commented Sep 14, 2013

Copy link
Copy Markdown
Member

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

@laruence

Copy link
Copy Markdown
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

krakjoe commented Sep 15, 2013

Copy link
Copy Markdown
Member Author

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