Bug #78682 [Com]: wrong executed if-else

From: Date: Thu, 17 Oct 2019 22:43:14 +0000
Subject: Bug #78682 [Com]: wrong executed if-else
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-223231@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78682&edit=1

 ID:                 78682
 Comment by:         bugreports at gmail dot com
 Reported by:        bugreports at gmail dot com
 Summary:            wrong executed if-else
 Status:             Open
 Type:               Bug
 Package:            opcache
 Operating System:   Linux
 PHP Version:        master-Git-2019-10-17 (Git)
 Block user comment: N
 Private report:     N

 New Comment:

it is for sure the jit

$null is also undefined in the same line no matter if it write it with a swicth or if-else while
it's impossible that $null is later in this loop is undefined

comment out that two lines from php.ini and the code works as before

#opcache.jit_buffer_size          = 50000000
#opcache.jit                      = 1235

  foreach($this->parent->query_fetch_all("describe $table") as $row)
  {
   $null = 0;
   if(strtolower($row['Null']) === 'yes')
   {
    $null = 1;
   }
   ..............
  }


Previous Comments:
------------------------------------------------------------------------
[2019-10-17 22:08:40] bugreports at gmail dot com

Description:
------------
it's impossiblöe that $ml is undefined in that if-else statement

opcache.jit_buffer_size          = 50000000 
opcache.jit                      = 1235

Warning: Undefined variable: ml in global_mysql_ext.inc.php on line 581

   switch($extended)
   {
    default:
      $arr[$row['Field']] = $x_type;
      break;
    case 1:
      if($maxlength)
      {
       $rw = mysqli_fetch_row($this->parent->query("select
max(length({$row['Field']})) from $table", 1));
       $ml = (int)$rw[0];
      }
      else
      {
       $ml = 0;
      }
      $arr[$row['Field']] = ['type'=>$x_type, 'null'=>$null,
'length'=>$length, 'maxlength'=>$ml]; /** this is line 581 */
      break;
   }



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=78682&edit=1


Thread (5 messages)

« previous php.bugs (#223231) next »