logo       

Re: cvs: ZendEngine2(PHP_5_2) / zend_compile.c: msg#00050

Subject: Re: cvs: ZendEngine2(PHP_5_2) / zend_compile.c
The primary reason I went this route rather than handling it in the parser (I did consider it), was so that a clearer error message could be given than "Unexpected T_STRING". If you'd rather, I'd be happy to move this fix over there...

-Sara


Not sure this is the right fix. It probably makes more sense to fix the
parser itself and use r_variable instead of expr for the instanceof rule.
Did you try and have problems doing so? I just took a quick look so it might
be a bit more involved than that.

-----Original Message-----
From: Sara Golemon [mailto:pollita@xxxxxxx] Sent: Tuesday, December 12, 2006 3:25 PM
To: zend-engine-cvs@xxxxxxxxxxxxx
Subject: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_2) / zend_compile.c
pollita         Tue Dec 12 23:25:23 2006 UTC

  Modified files:              (Branch: PHP_5_2)
/ZendEngine2 zend_compile.c Log:
  MFH: Bugfix# 39435: 'foo' instanceof bar gives invalid opcode error
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.
647.2.27.2.21&r2=1.647.2.27.2.22&diff_format=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.647.2.27.2.21 ZendEngine2/zend_compile.c:1.647.2.27.2.22 --- ZendEngine2/zend_compile.c:1.647.2.27.2.21 Tue Dec 5 19:03:51 2006
+++ ZendEngine2/zend_compile.c  Tue Dec 12 23:25:23 2006
@@ -17,7 +17,7 @@
+-------------------------------------------------------------
---------+
 */
-/* $Id: zend_compile.c,v 1.647.2.27.2.21 2006/12/05 19:03:51 dmitry Exp $ */ +/* $Id: zend_compile.c,v 1.647.2.27.2.22 2006/12/12 23:25:23 pollita +Exp $ */ #include <zend_language_parser.h>
 #include "zend.h"
@@ -3627,6 +3627,10 @@
                }
        }
+ if (expr->op_type == IS_CONST) { + zend_error(E_COMPILE_ERROR, "instanceof expects an object instance, constant given");
+       }
+
        opline = get_next_op(CG(active_op_array) TSRMLS_CC);
        opline->opcode = ZEND_INSTANCEOF;
        opline->result.op_type = IS_TMP_VAR;


--
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe