Skip to content

Commit

Permalink
Removed unnecassary checks
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Mar 18, 2009
1 parent 8235286 commit 3a30cfe
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 95 deletions.
11 changes: 4 additions & 7 deletions Zend/zend_vm_def.h
Expand Up @@ -1614,7 +1614,7 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
PZVAL_LOCK(*value_ptr_ptr);
}
if (OP1_TYPE == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) {
zend_error(E_ERROR, "Cannot assign by reference to overloaded object");
zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object");
}

variable_ptr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
Expand Down Expand Up @@ -1956,10 +1956,7 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV)
zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
}

if (!EX(object)) {
EX(called_scope) = NULL;
EX(object) = NULL;
} else if (EX(fbc) && (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
EX(object) = NULL;
} else {
if (!PZVAL_IS_REF(EX(object))) {
Expand Down Expand Up @@ -1991,7 +1988,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS
/* no function found. try a static method in class */
ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
if (!ce) {
zend_error(E_ERROR, "Class '%s' not found", Z_STRVAL(opline->op1.u.constant));
zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL(opline->op1.u.constant));
}
EX(called_scope) = ce;
} else {
Expand Down Expand Up @@ -2029,7 +2026,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS
EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
}
if (!EX(fbc)) {
zend_error(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval);
zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval);
}
}

Expand Down

0 comments on commit 3a30cfe

Please sign in to comment.