Skip to content

Commit 0c3fe96

Browse files
committed
Remove always-true check
1 parent ba52d30 commit 0c3fe96

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

ext/dom/php_dom.c

+7-10
Original file line numberDiff line numberDiff line change
@@ -380,18 +380,15 @@ zval *dom_write_property(zend_object *object, zend_string *name, zval *value, vo
380380
}
381381

382382
zend_property_info *prop = zend_get_property_info(object->ce, name, /* silent */ true);
383-
if (prop && ZEND_TYPE_IS_SET(prop->type)) {
384-
zval tmp;
385-
ZVAL_COPY(&tmp, value);
386-
if (!zend_verify_property_type(prop, &tmp, ZEND_CALL_USES_STRICT_TYPES(EG(current_execute_data)))) {
387-
zval_ptr_dtor(&tmp);
388-
return &EG(error_zval);
389-
}
390-
hnd->write_func(obj, &tmp);
383+
ZEND_ASSERT(prop && ZEND_TYPE_IS_SET(prop->type));
384+
zval tmp;
385+
ZVAL_COPY(&tmp, value);
386+
if (!zend_verify_property_type(prop, &tmp, ZEND_CALL_USES_STRICT_TYPES(EG(current_execute_data)))) {
391387
zval_ptr_dtor(&tmp);
392-
} else {
393-
hnd->write_func(obj, value);
388+
return &EG(error_zval);
394389
}
390+
hnd->write_func(obj, &tmp);
391+
zval_ptr_dtor(&tmp);
395392

396393
return value;
397394
}

0 commit comments

Comments
 (0)