Skip to content

Fix ZipArchive addFromString AOT entry names (#35454) - #35710

Merged
PurHur merged 1 commit into
masterfrom
fix/ziparchive-addfromstring-aot-35454
Aug 29, 2026
Merged

Fix ZipArchive addFromString AOT entry names (#35454)#35710
PurHur merged 1 commit into
masterfrom
fix/ziparchive-addfromstring-aot-35454

Conversation

@PurHur

@PurHur PurHur commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • AOT ZipArchive::addFromString() wrote zip entries named status/open_create (stale exec() $op strings) with empty payload instead of the requested filename/content.
  • Route addFromString through a dedicated NestedJIT ZipArchiveJitHelper::addEntry(string $name, string $content) helper; keep exec() add branch as a delegate for VM/other callers.
  • Register addEntry in ZipArchiveEmbedBridge and add minimal repro test/repro/zip_minimal_add_aot.php.

php-src: ext/zip/php_zip.czim_ZipArchive_addFromString

Test plan

export PHP_COMPILER_ENABLE_ZIP=1
./script/phpunit.sh --filter ZipArchiveMultiAddAotTest
# OK (2 tests, 8 assertions)

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

Closes #35454

Made with Cursor

).

Thin AOT routed addFromString through exec()'s multi-string formals where s1/s2
read stale op strings ('status', 'open_create') instead of filename/content.
Route add through a dedicated NestedJIT addEntry(name, content) entrypoint.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 7ea9244 into master Aug 29, 2026
1 check failed
@PurHur
PurHur deleted the fix/ziparchive-addfromstring-aot-35454 branch August 29, 2026 09:05
PurHur added a commit that referenced this pull request Aug 29, 2026
…d NestedJIT helpers (#35449/#35496). (#35714)

Peer #35710 addEntry — exec() $s2 formal aliasing under thin AOT dropped file_get_contents payloads, leaving empty zip entries after close/reopen.

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
PurHur added a commit that referenced this pull request Aug 29, 2026
…pers (#35476). (#35736)

exec() formal aliasing dropped setArchiveComment payloads under thin AOT;
peer addEntry/replaceEntry split (#35454/#35710).

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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: ZipArchive::addFromString second call overwrites first entry — archive loses prior files (ext/zip/php_zip.c)

1 participant