You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Preserve runtime.Error/error panic values for runtime-generated panics used during interface comparison evaluation.
Route failed non-comma-ok type assertions through a runtime helper so recovered values are error-like, matching Go's runtime behavior.
Add nil-deref guarding for interface dereferences consumed directly by comparisons, covering fixedbugs/issue32187.go.
Add stable test/go coverage for interface comparison evaluation panics and remove fixed issue32187.go xfails.
Tests
go test ./test/go -run 'TestInterfaceCompare|TestNilPointer' -count=1
go run -tags=dev ./cmd/llgo test -run '^TestInterfaceCompare' ./test/go
go test ./ssa -run 'TestTypeAssert|TestMakeInterface|TestBinOp' -count=1
(cd runtime && go test ./internal/runtime ./abi -count=1)
LLGO_BUILD_CACHE=off go test ./cl -run 'TestRunAndTestFromTestgo/(cursor|ifaceprom)$' -count=1
LLGO_BUILD_CACHE=off go test ./cl -run 'TestCompileLargeNilDerefInterfaceGuards|TestRunAndTestFromTestgo' -count=1
go test ./test/goroot -run TestGoRootRunCases/fixedbugs/issue32187.go -count=1 -args -goroot "$(go env GOROOT)" -dirs fixedbugs -case '^fixedbugs/issue32187\.go$' -xfail /dev/null -run-timeout=30s -build-timeout=3m
go test ./test/goroot -run TestGoRootRunCases/fixedbugs/issue32187.go -count=1 -args -goroot "$(go env GOROOT)" -dirs fixedbugs -case '^fixedbugs/issue32187\.go$' -run-timeout=30s -build-timeout=3m
Notes
Targeted GOROOT run used the current machine GOROOT (go env GOROOT, Go 1.24.11). Full GOROOT CI remains slow/disabled here; relying on normal PR CI from the fork branch.
No manual workflow_dispatch was started. If the manual GOROOT workflow cannot resolve fork refs, document that in this PR rather than pushing to xgo-dev/llgo.
在 test/go/interface_uncomparable_panic_test.go 增加 T comparable 且 T=any 的动态不可比较值覆盖,确保功能覆盖落在 test/go。
本地测试:
go test ./test/go -run 'TestInterfaceCompare|TestComparableTypeParamInterfaceValuePanics' -count=1 -v ✅
go test ./cl -run 'TestRunAndTestFromTestgo/genericembediface|TestRunAndTestFromTestrt/(any|funcdecl|makemap|tpabi|typed)|TestRunAndTestFromTestdata/vargs' -count=1 -v ✅
go test ./ssa -run 'TestFromTestgo/genericembediface|TestFromTestrt/(any|funcdecl|makemap|tpabi|typed)|TestFromTestdata/vargs' -count=1 -v ✅
2026-05-24 verification update for fixedbugs/issue32187.go:
Classified as in-scope for this PR: interface-to-concrete comparison evaluation and panic ordering. The case checks that comparison lowering does not short-circuit away RHS/LHS panics from type assertions, bounds checks, and nil dereferences.
Coverage is already present in test/go/interface_uncomparable_panic_test.go via TestInterfaceCompareEvaluationPanicsAreRuntimeErrors, mirroring the upstream issue32187.go subcases. The nil-deref entries are covered only as comparison evaluation-order subcases; this PR does not expand into broader nil-specific work, chan, print, recover, GC, liveness, finalizer, or goroutine areas.
fixedbugs/issue32187.go xfails for darwin/arm64 and linux/amd64 have been removed in this branch. No remaining issue32187.go xfail is present.
Local verification on /Users/lijie/sdk/go1.26.0 and this branch HEAD 957cc66468e4454bb19ad941d93683d0747f2168:
go test ./test/goroot -run TestGoRoot -count=1 -args -goroot /Users/lijie/sdk/go1.26.0 -dirs fixedbugs -case "^fixedbugs/issue32187\\.go$" -directive-mode legacy -> pass
go test ./test/go -run TestInterfaceCompareEvaluationPanicsAreRuntimeErrors -count=1 -> pass
go test ./test/go -count=1 -> pass
go test ./ssa ./cl -count=1 -> pass (cl took ~546s)
(cd runtime && go test ./... -run TestNonExistent -count=1) -> pass/no test failures
Note: go test ./runtime/... -count=1 from the repo root fails at package discovery because runtime/ is a nested module; the runtime module test above is the applicable form.
Additional runtime module check for the same 2026-05-24 verification:
(cd runtime && go test ./internal/runtime ./abi -count=1) -> pass (runtime/internal/runtime has no test files, runtime/abi passed).
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
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
test/gocoverage for interface comparison evaluation panics and remove fixedissue32187.goxfails.Tests
go test ./test/go -run 'TestInterfaceCompare|TestNilPointer' -count=1go run -tags=dev ./cmd/llgo test -run '^TestInterfaceCompare' ./test/gogo test ./ssa -run 'TestTypeAssert|TestMakeInterface|TestBinOp' -count=1(cd runtime && go test ./internal/runtime ./abi -count=1)LLGO_BUILD_CACHE=off go test ./cl -run 'TestRunAndTestFromTestgo/(cursor|ifaceprom)$' -count=1LLGO_BUILD_CACHE=off go test ./cl -run 'TestCompileLargeNilDerefInterfaceGuards|TestRunAndTestFromTestgo' -count=1go test ./test/goroot -run TestGoRootRunCases/fixedbugs/issue32187.go -count=1 -args -goroot "$(go env GOROOT)" -dirs fixedbugs -case '^fixedbugs/issue32187\.go$' -xfail /dev/null -run-timeout=30s -build-timeout=3mgo test ./test/goroot -run TestGoRootRunCases/fixedbugs/issue32187.go -count=1 -args -goroot "$(go env GOROOT)" -dirs fixedbugs -case '^fixedbugs/issue32187\.go$' -run-timeout=30s -build-timeout=3mNotes
go env GOROOT, Go 1.24.11). Full GOROOT CI remains slow/disabled here; relying on normal PR CI from the fork branch.workflow_dispatchwas started. If the manual GOROOT workflow cannot resolve fork refs, document that in this PR rather than pushing toxgo-dev/llgo.