Баг try/catch/while/break

Issue #79 new
xdasm-admin created an issue

Исходник:

<?php

 try {
             $attribute = new ReflectionProperty($object, $attributeName);
         }

         catch (ReflectionException $e) {
             $reflector = new ReflectionObject($object);

             while ($reflector = $reflector->getParentClass()) {
                 try {
                     $attribute = $reflector->getProperty($attributeName);
                     break;
                 }

                 catch (ReflectionException $e) {
                 }
             }
         }

Результат:

<?php


try {
        $attribute = new ReflectionProperty($object, $attributeName);
}
catch (ReflectionException $e) {
2707: $blockLast(24) > $range[1](23)
/*
2709: ::printBacktrace()
2227: Decompiler::recognizeAndDecompileClosedBlocks(array(0 => 8, 1 => 23))
1869: Decompiler::decompile_tryCatch(array(0 => 0, 1 => 24), array(0 => array, 1 => array, 2 => array, 3 => array, 4 => array, ...), array('
op1' => array, 'op2' => array, 'result' => array, 'opcode' => 109, 'extended_value' => 4, ...), array('op1' => array, 'op2' => array, 'resul
t' => array, 'opcode' => 42, 'extended_value' => 0, ...))
2716: Decompiler::decompileComplexBlock(array(0 => 0, 1 => 24))
3233: Decompiler::recognizeAndDecompileClosedBlocks(array(0 => 0, 1 => 25))
5025: Decompiler::dop_array(array('type' => 2, 'function_name' => NULL, 'fn_flags' => 0, 'arg_info' => NULL, 'num_args' => 0, ...))
36: Decompiler::output()
*/
        $reflector = new ReflectionObject($object);

2707: $blockLast(24) > $range[1](21)
        while ($reflector = $reflector->getParentClass()) {
                try {
/*
2709: ::printBacktrace()
2206: Decompiler::recognizeAndDecompileClosedBlocks(array(0 => 17, 1 => 21))
1869: Decompiler::decompile_tryCatch(array(0 => 17, 1 => 24), array(0 => array, 1 => array, 2 => array, 3 => array, 4 => array, ...), array(
'op1' => array, 'op2' => array, 'result' => array, 'opcode' => 112, 'extended_value' => 0, ...), array('op1' => array, 'op2' => array, 'resu
lt' => array, 'opcode' => 42, 'extended_value' => 0, ...))
2716: Decompiler::decompileComplexBlock(array(0 => 17, 1 => 24))
2431: Decompiler::recognizeAndDecompileClosedBlocks(array(0 => 16, 1 => 24))
1853: Decompiler::decompile_while(array(0 => 16, 1 => 24), array(0 => array, 1 => array, 2 => array, 3 => array, 4 => array, ...), array('op
1' => array, 'op2' => array, 'result' => array, 'opcode' => 43, 'extended_value' => 0, ...), array('op1' => array, 'op2' => array, 'result'
=> array, 'opcode' => 42, 'extended_value' => 0, ...), array('op1' => array, 'op2' => array, 'result' => array, 'opcode' => 43, 'extended_va
lue' => 0, ...), array('op1' => array, 'op2' => array, 'result' => array, 'opcode' => 42, 'extended_value' => 0, ...))
2716: Decompiler::decompileComplexBlock(array(0 => 16, 1 => 24))
2227: Decompiler::recognizeAndDecompileClosedBlocks(array(0 => 8, 1 => 23))
1869: Decompiler::decompile_tryCatch(array(0 => 0, 1 => 24), array(0 => array, 1 => array, 2 => array, 3 => array, 4 => array, ...), array('
op1' => array, 'op2' => array, 'result' => array, 'opcode' => 109, 'extended_value' => 4, ...), array('op1' => array, 'op2' => array, 'resul
t' => array, 'opcode' => 42, 'extended_value' => 0, ...))
2716: Decompiler::decompileComplexBlock(array(0 => 0, 1 => 24))
3233: Decompiler::recognizeAndDecompileClosedBlocks(array(0 => 0, 1 => 25))
5025: Decompiler::dop_array(array('type' => 2, 'function_name' => NULL, 'fn_flags' => 0, 'arg_info' => NULL, 'num_args' => 0, ...))
36: Decompiler::output()
*/
                        $attribute = $reflector->getProperty($attributeName);
                        /*
                        21 13  BRK                       ?0        ?0                   1                       ;0      >>25
                        22 16  JMP                       ?0        ?24                  ?0                      ;0      >>24
                        23 16  CATCH                     ?1        "ReflectionException" $e                     ;24 CB
                        24 18  JMP                       ?0        ?13                  ?0                      ;0      <<22
                        */

                        break;
                }
                catch (ReflectionException $e) {
                }
        }
}

?>

Comments (3)

  1. sidxx55

    в официальной версии должен быть фикс try/catch но с вложенностью не уверен

  2. sidxx55

    есть предположение что некоторые конструкции for заменяются на while, может не баг конечно

  3. sidxx55

    часто встречается ошибка либо алерт (string 49), такого плана, к чему это?

    string(49) "@socket_get_status($fp) && !@feof($fp) && $status" <<<<<<<<<<<<<<
                while (@socket_get_status($fp) && !@feof($fp) && $status) {
                    $data .= @fgets($fp, 1024);
    
                    if (@function_exists("socket_get_status")) {
                        $status = @socket_get_status($fp);
                    }
                    else if (@feof($fp) == true) {
                        $status = false;
                    }
                    else {
                        $status = true;
                    }
                }
    
  4. Log in to comment