Skip to content

AOT: RecursiveIteratorIterator LEAVES_ONLY flatten honors SKIP_DOTS (#34624) - #35572

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-34624-rii-skip-dots
Aug 28, 2026
Merged

AOT: RecursiveIteratorIterator LEAVES_ONLY flatten honors SKIP_DOTS (#34624)#35572
PurHur merged 1 commit into
masterfrom
agent/issue-34624-rii-skip-dots

Conversation

@PurHur

@PurHur PurHur commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • When RecursiveIteratorIterator flattens an inner RecursiveDirectoryIterator hashtable for LEAVES_ONLY thin AOT, skip ./.. filename leaves when the inner iterator carries FilesystemIterator::SKIP_DOTS in __flags (php-src spl_directory.c readCurrent semantics).
  • Mirrors directory iterator foreach: scandir snapshot still holds dot entries; iteration and RII flatten now both filter them.

php-src

  • ext/spl/spl_directory.cSPL_FILE_DIR_SKIP_DOTS / spl_filesystem_dir_read

Verify

./script/aot-smoke.sh
# aot-smoke: 8 passed, 0 failed

./script/phpunit.sh --filter RecursiveDirectoryIterator34624AotTest
# OK (4 tests, 10 assertions)

./script/docker-exec.sh -- bash -lc 'php bin/compile.php -o /tmp/rdi.bin test/repro/recursivedirectoryiterator_aot_34624.php && /tmp/rdi.bin'
# rdi:a.txt
# rii:a.txt
# rii_ok:1

Closes #34624

Made with Cursor

…y ht (#34624).

RII LEAVES_ONLY flatten was copying raw scandir entries including `.`/`..` while
direct RDI foreach skips them via __flags — pass skip_dots into flatten walk.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit c14371b into master Aug 28, 2026
1 check failed
@PurHur
PurHur deleted the agent/issue-34624-rii-skip-dots branch August 28, 2026 00:03
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.

AOT: RecursiveDirectoryIterator foreach empty / RII+RDI SIGSEGV — no thin-AOT construct proxies (ext/spl/spl_directory.c)

1 participant