#26685 [Opn]: Doing a continue 0 within a switch is causing a seg fault

From: Date: Mon, 22 Dec 2003 00:50:59 +0000
Subject: #26685 [Opn]: Doing a continue 0 within a switch is causing a seg fault
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-52358@lists.php.net to get a copy of this message
ID: 26685 User updated by: sc1n at yahoo dot com Reported By: sc1n at yahoo dot com Status: Open Bug Type: Reproducible crash Operating System: Gentoo Linux 2.6 Kernel PHP Version: 4.3.4 New Comment: This is really a logic error as well, as I should have done a continue 1 or continue 0 with a break, however I guess it should still be addressed because it does consitantly cash a seg fault. Previous Comments: ------------------------------------------------------------------------ [2003-12-21 19:17:39] sc1n at yahoo dot com Description: ------------ I used a terinary operator to do a continue 0 or continue 2 within a switch, and this caused PHP to seg fault... I am able to consitantly reproduce the bug. Reproduce code: --------------- while( $value_array = each($this->tags) ) { $key = $value_array[0]; $value = $value_array[1]; $value['tag_id'] = $key; switch($tag_pos_type) { case "start": continue $value[3] == 1 ? 2: 0; //The problem case "end": continue $value[3] == 0 ? 2: 0; //The problem } if( is_array($tag_type_array) ) { if( in_array($value[0], $tag_type_array) ) { return $value; } } else { return $value; } } Expected result: ---------------- To either continue not at all, or to continue 2 Actual result: -------------- segmentation fault ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26685&edit=1

« previous php.bugs (#52358) next »