php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56850 binary_assign/binary_assign_objdim doesn't work and segfaults
Submitted: 2006-02-20 17:50 UTC Modified: 2013-07-18 01:36 UTC
From: elias at adaptiveinstance dot com Assigned: pollita (profile)
Status: Closed Package: operator (PECL)
PHP Version: 5.0.5 OS: linux
Private report: No CVE-ID: None
 [2006-02-20 17:50 UTC] elias at adaptiveinstance dot com
Description:
------------
I cannot compile any version of the operator extension (0.1 - 0.3). During compilation the following error occurs multiple times:

'struct _zend_op' has no member named 'code'

i've rewritten the 'code' member to 'opcode' and then it compiled.

--file: operator.c, line: 177
--OLD 
#define PHP_OPERATOR_DECODE(opline)					(opline->code)

--NEW
#define PHP_OPERATOR_DECODE(opline)					(opline->opcode)



Reproduce code:
---------------




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-20 17:53 UTC] elias at adaptiveinstance dot com
oh, the change above are for RELEASE_0_3
 [2006-02-20 18:35 UTC] elias at adaptiveinstance dot com
stupid /me. compiles fine but does not work :)
 [2006-02-20 22:45 UTC] pollita@php.net
Thanks for spotting the code/opcode typo.  I've fixed that in CVS, can you elaborate on the "doesn't work" part of your bug report?

Maybe a reproducing script?
 [2006-02-21 15:14 UTC] elias at adaptiveinstance dot com
>>> test summary:
FAIL Basic binary assign ops [tests/binary_assign.phpt]
PASS Basic comparison ops [tests/compare.phpt]
SKIP Extended comparison ops [tests/compare2.phpt]
PASS Inc/Dec ops [tests/incdec.phpt]
PASS Basic unary ops [tests/unary.phpt]

>>> binary_assign.phpt:
---- EXPECTED OUTPUT
int(7)
int(4)
int(12)
int(6)
int(0)
int(56)
int(14)
string(8) "PHP with"
string(20) "PHP with overloading"
int(250)
int(170)
int(0)
---- ACTUAL OUTPUT
Fatal error: Unsupported operand types in /tmp/operator-0.3/tests/binary_assign.php on line 56
---- FAILED

i've ommited the fatal error causing operators but the script returns unexpected results and segfaults with most combinations operators. doing two consecutive assignments on one object is a safe way to generate a segfault.

current binary_assign_objdim.phpt is not testable because it  segfaults. further it breaks on "unsupported operand types" error if i comment out one of the operator assignment lines.
 [2013-07-18 01:36 UTC] pollita@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: pollita
 [2013-07-18 01:36 UTC] pollita@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC