Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pbiggar opened this issue Jun 3, 2015 · 1 comment
Open

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

pbiggar opened this issue Jun 3, 2015 · 1 comment

Comments

@pbiggar
Copy link
Owner

pbiggar commented Jun 3, 2015

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.alain.le.borgne on 2009-04-06 12:30:33


- _Attachment: [test-parent.php](https://storage.googleapis.com/google-code-attachments/phc/issue-110/comment-0/test-parent.php)_
@pbiggar
Copy link
Owner Author

pbiggar commented Jun 3, 2015

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 issue reported on code.google.com by paul.biggar on 2009-04-06 15:23:52

  • Labels added: Priority-High, Component-Codegen, Difficulty-Easy
  • Labels removed: Priority-Medium

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant