FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Avoid generic verify scan when no turbofish args by prateekbhujel · Pull Request #2 · carthage-software/php-src · GitHub

Avoid generic verify scan when no turbofish args - #2

Merged
azjezz merged 1 commit into
carthage-software:rfc/bound-erased-generic-types-historyfrom
prateekbhujel:prateekbhujel/generics-skip-empty-optimizer-scan-history
May 12, 2026
Merged

Avoid generic verify scan when no turbofish args#2
azjezz merged 1 commit into
carthage-software:rfc/bound-erased-generic-types-historyfrom
prateekbhujel:prateekbhujel/generics-skip-empty-optimizer-scan-history

Conversation

prateekbhujel commented May 12, 2026
edited
Loading

Copy link
Copy Markdown

zend_try_inline_call() only needs to scan back for VERIFY_GENERIC_ARGUMENTS when the current op array actually has turbofish args recorded.

For non-generic call sites, op_array->generic_types or op_array->generic_types->turbofish_args is empty, so the scan cannot find anything useful.

Tests run:

sapi/cli/php run-tests.php -q \
  Zend/tests/generics/syntax/turbofish_function_call.phpt \
  Zend/tests/generics/syntax/turbofish_method_call.phpt \
  Zend/tests/generics/syntax/turbofish_new.phpt \
  Zend/tests/generics/turbofish/arity/function_too_many.phpt \
  Zend/tests/generics/turbofish/arity/non_generic_callee.phpt \
  Zend/tests/generics/turbofish/bounds/function_call_violates.phpt \
  Zend/tests/generics/erasure/turbofish_no_runtime_effect.phpt \
  Zend/tests/generics/turbofish/bounds/attribute_under_opcache.phpt \
  ext/opcache/tests/optimize_func_calls.phpt \
  ext/opcache/tests/wrong_inlining_001.phpt \
  ext/opcache/tests/bug77691.phpt
sapi/cli/php run-tests.php -q Zend/tests/generics ext/reflection/tests/generics

Result: 407/407 passed for the full generics + reflection generics suite.

azjezz merged commit 0c956d4 into carthage-software:rfc/bound-erased-generic-types-history May 12, 2026
1 check passed
azjezz pushed a commit that referenced this pull request Jun 9, 2026
…dict

```
Direct leak of 52 byte(s) in 1 object(s) allocated from:
    #0 0x7ff90cd2c161 in malloc (/usr/lib/libasan.so.8+0x12c161) (BuildId: ee5fbab73143ab257a66a33afe0f038a4af7a74e)
    #1 0x55de10c9a468 in tracked_malloc /work/php-8.4/Zend/zend_alloc.c:2973
    #2 0x55de10c99443 in _emalloc /work/php-8.4/Zend/zend_alloc.c:2740
    #3 0x55de102deb86 in zlib_create_dictionary_string /work/php-8.4/ext/zlib/zlib.c:836
    #4 0x55de102e145a in zif_deflate_init /work/php-8.4/ext/zlib/zlib.c:1144
    #5 0x55de10dcac6c in ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER /work/php-8.4/Zend/zend_vm_execute.h:1351
    #6 0x55de10f2d69d in execute_ex /work/php-8.4/Zend/zend_vm_execute.h:58907
    #7 0x55de10f41666 in zend_execute /work/php-8.4/Zend/zend_vm_execute.h:64334
    php#8 0x55de110a6cf8 in zend_execute_script /work/php-8.4/Zend/zend.c:1934
    php#9 0x55de10af0ddb in php_execute_script_ex /work/php-8.4/main/main.c:2577
    php#10 0x55de10af128f in php_execute_script /work/php-8.4/main/main.c:2617
    php#11 0x55de110ac5e1 in do_cli /work/php-8.4/sapi/cli/php_cli.c:935
    php#12 0x55de110ae592 in main /work/php-8.4/sapi/cli/php_cli.c:1322
    php#13 0x7ff90c027740  (/usr/lib/libc.so.6+0x27740) (BuildId: 020d6f7c33b2413f4fe10814c4729dce1387f049)
    php#14 0x7ff90c027878 in __libc_start_main (/usr/lib/libc.so.6+0x27878) (BuildId: 020d6f7c33b2413f4fe10814c4729dce1387f049)
    php#15 0x55de10005964 in _start (/work/php-8.4/sapi/cli/php+0x605964) (BuildId: 5f144db4e56ea623e070c56445fb1dfa3f8d085d)

SUMMARY: AddressSanitizer: 52 byte(s) leaked in 1 allocation(s).
```

Closes phpGH-22101.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL