Skip to content

Commit 02d5362

Browse files
committed
Fix type mask
1 parent 0daf42e commit 02d5362

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

build/gen_stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,9 +1062,9 @@ function (Expr $expr) use (&$defaultValueConstant) {
10621062
$code .= "\tproperty_{$propertyName}_type_list->types[$k] = (zend_type) ZEND_TYPE_INIT_CLASS(property_{$propertyName}_class_{$className}, 0, 0);\n";
10631063
}
10641064

1065-
$isNullable = $this->type->isNullable();
1065+
$typeMaskCode = $this->type->toArginfoType()->toTypeMask();
10661066

1067-
$code .= "\tzend_type property_{$propertyName}_type = ZEND_TYPE_INIT_PTR(property_{$propertyName}_type_list, _ZEND_TYPE_LIST_BIT, $isNullable, 0);\n";
1067+
$code .= "\tzend_type property_{$propertyName}_type = ZEND_TYPE_INIT_PTR(property_{$propertyName}_type_list, _ZEND_TYPE_LIST_BIT, 0, $typeMaskCode);\n";
10681068
$typeCode = "property_{$propertyName}_type";
10691069
} else {
10701070
$simpleType = $this->type->tryToSimpleType();

ext/zend_test/test_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ static zend_class_entry *register_class__ZendTestClass(zend_class_entry *class_e
210210
property_classUnionProp_type_list->num_types = 2;
211211
property_classUnionProp_type_list->types[0] = (zend_type) ZEND_TYPE_INIT_CLASS(property_classUnionProp_class_stdClass, 0, 0);
212212
property_classUnionProp_type_list->types[1] = (zend_type) ZEND_TYPE_INIT_CLASS(property_classUnionProp_class_Iterator, 0, 0);
213-
zend_type property_classUnionProp_type = ZEND_TYPE_INIT_PTR(property_classUnionProp_type_list, _ZEND_TYPE_LIST_BIT, 1, 0);
213+
zend_type property_classUnionProp_type = ZEND_TYPE_INIT_PTR(property_classUnionProp_type_list, _ZEND_TYPE_LIST_BIT, 0, MAY_BE_NULL);
214214
zval property_classUnionProp_default_value;
215215
ZVAL_NULL(&property_classUnionProp_default_value);
216216
zend_string *property_classUnionProp_name = zend_string_init("classUnionProp", sizeof("classUnionProp") - 1, 1);

0 commit comments

Comments
 (0)