Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Zend/Optimizer/compact_literals.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,14 +696,14 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx
break;
case ZEND_VERIFY_GENERIC_ARGUMENTS:
case ZEND_INSTALL_GENERIC_ARGS:
/* When this site has a turbofish (args_id in extended_value),
* the compiler allocated a 2-slot inline cache for the
* (zend_type_arg_table*, cache key) pair — re-allocate it
* here so the offset stays in sync with compact_literals'
* fresh cache_size. */
if (opline->extended_value != 0) {
/* When this site has a turbofish (args_id in extended_value)
* or is a call (op1_type == IS_UNUSED, which caches its table
* regardless), the compiler allocated a 5-slot inline cache —
* re-allocate it here so the offset stays in sync with
* compact_literals' fresh cache_size. */
if (opline->extended_value != 0 || opline->op1_type == IS_UNUSED) {
opline->result.num = cache_size;
cache_size += 2 * sizeof(void *);
cache_size += 5 * sizeof(void *);
}
break;
case ZEND_CATCH:
Expand Down
4 changes: 2 additions & 2 deletions Zend/tests/generics/reification/inference_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ try {
echo "TypeError: ", $e->getMessage(), "\n";
}
?>
--EXPECT--
--EXPECTF--
Foo
Bar
TypeError: kind(): Argument #1 ($x) must be of type Foo, Bar given
TypeError: kind(): Argument #1 ($x) must be of type Foo, Bar given, called in %s on line %d
8 changes: 4 additions & 4 deletions Zend/tests/generics/reification/variadic_t_reified.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ try {
?>
--EXPECTF--
int(6)
1: sum(): Argument #2 ($xs) must be of type int, string given
2: sum(): Argument #3 ($xs) must be of type int, string given
1: sum(): Argument #2 must be of type int, string given, called in %s on line %d
2: sum(): Argument #3 must be of type int, string given, called in %s on line %d
string(6) ":: 123"
3: concat(): Argument #3 ($xs) must be of type int, array given
3: concat(): Argument #3 must be of type int, array given, called in %s on line %d
int(3)
4: herd(): Argument #2 ($xs) must be of type Dog, Cat given
4: herd(): Argument #2 must be of type Dog, Cat given, called in %s on line %d
Loading