]> granicus.if.org Git - php/commitdiff
Bugfix# 39435: 'foo' instanceof bar gives invalid opcode error
authorSara Golemon <pollita@php.net>
Tue, 12 Dec 2006 23:09:01 +0000 (23:09 +0000)
committerSara Golemon <pollita@php.net>
Tue, 12 Dec 2006 23:09:01 +0000 (23:09 +0000)
Zend/zend_compile.c

index 0a6a230a78c892b18e3dc94cd331f4773f631293..8c15ad379e435c6e79f8da5783a569951719386e 100644 (file)
@@ -3850,6 +3850,10 @@ void zend_do_instanceof(znode *result, znode *expr, znode *class_znode, int type
                }
        }
 
+       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;