fix: loops compliance + php-llvm patches (#192)#326
Merged
Conversation
…192) - Replace corrupt php-llvm patches with valid git-apply diffs: Value::addIncoming + LLVMAbstract Value implementation; Builder and()/or() aliases. - Teach apply-patches.sh to apply the split patches (drop broken combined phi patch). - Add compliance PHPT coverage for for/while/do-while (VM + @group llvm JIT file). - Remove Stmt_While/For/Do from UnsupportedRegistry and docs table (CFG uses Jump/JumpIf). - Harden script/php-env.sh so a bogus executable-as-directory php candidate is skipped. Fixes #192. Co-authored-by: Cursor <cursoragent@cursor.com>
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
while/for/do-whileare lowered by php-cfg toJump/JumpIf; VM/JIT already execute that shape. This PR adds PHPT coverage and stopsphpc lintfrom falsely flagging AST loop kinds viaUnsupportedRegistry.patches/php-llvm-phi-add-incoming.patch+php-llvm-builder-and-or.patchwere corrupt (git applynever applied), soLLVMAddIncoming/Builder::and/ornever landed in freshcomposer installtrees; JIT init fatals. Replaced with valid patches:patches/php-llvm-value-addincoming.patchpatches/php-llvm-llvmabstract-value-addincoming.patchpatches/php-llvm-builder-and-or.patchscript/php-env.shnow skips non-executable / directoryphpcandidates (harness quirk:exec: php: Is a directory).Tests (local / Docker)
docker run ... php-compiler:22.04-dev+vendor/bin/phpunit test/compliance/VMTest.php→ OK (174 tests) including newloops.phpt.script/ci-local.shfrom this harness appeared to stall after ~61% of the first PHPUnit batch in earlier runs (needs verification on a normal host); patch application now succeeds (seeApplied php-llvm-*lines when vendor is clean).Fixes #192.
Made with Cursor