ARudik / phc

Automatically exported from code.google.com/p/phc
0 stars 0 forks source link

Calling parent::__construct() crashes compiled program. #110

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Compile attached test-parent.php file with "phc -c test-parent.php -o
test-parent"
2. Run ./test-parent
3. Result: "SIGSEGV received!"

What is the expected output? What do you see instead?

Expected output (using "php test-parent.php"):

A constructor: B constructor: B object

What version of the product are you using? On what operating system?

From SVN, revision 2535.

OS: Debian Etch.

PHP used in phc compilation: tried with 5.2.0 (same as Debian package) and
5.2.9.

Please provide any additional information below.

It happens in the Zend API, in zend_is_callable_check_func when trying to
use EG(active_op_array), quick look with gdb shows that the active_op_array
member of the executor globals struct has a NULL value:

(gdb) p ((zend_executor_globals *) (*((void ***)
tsrm_ls))[((executor_globals_id)-1)])->active_op_array
$3 = (zend_op_array *) 0x0

Original issue reported on code.google.com by jean.ala...@gmail.com on 6 Apr 2009 at 12:30

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the report.

We think this is because we're trying to lookup the class "parent". I think the
correct fix is further up the pass queue, so that the code generator never sees
"parent", but instead sees (in this case) "a", the parent class name.

Original comment by paul.biggar on 6 Apr 2009 at 3:23