Skip to content

fix zero-sized deref comparisons#1920

Draft
cpunion wants to merge 1 commit into
xgo-dev:mainfrom
cpunion:codex/goroot-fixedbugs-zeroderef
Draft

fix zero-sized deref comparisons#1920
cpunion wants to merge 1 commit into
xgo-dev:mainfrom
cpunion:codex/goroot-fixedbugs-zeroderef

Conversation

@cpunion
Copy link
Copy Markdown
Collaborator

@cpunion cpunion commented May 24, 2026

Summary

  • add nil-deref guards for zero-sized loads and zero-sized field derefs
  • keep zero-sized function-result comparisons evaluating calls, including nil function panic behavior
  • add focused ssa/cl/test-go coverage and remove fixedbugs/issue23837.go xfail entries

Validation

  • go test ./ssa ./cl -run 'TestZeroSized' -count=1
  • go run ./cmd/llgo test -run 'TestZeroSize' ./test/go/zero_size_compare_test.go
  • go test ./test/go -run 'TestZeroSize' -count=1
  • /Users/lijie/sdk/go1.26.0/bin/go test ./test/goroot -run TestGoRootRunCases -count=1 -args -goroot /Users/lijie/sdk/go1.26.0 -go /Users/lijie/sdk/go1.26.0/bin/go -case 'fixedbugs/issue23837.go' -xfail /tmp/llgo-empty-xfail.yaml
  • also verified the same GOROOT case with Go 1.24.11 and Go 1.25.0 locally

Note: package-wide llgo test -run 'TestZeroSize' ./test/go currently fails at link time on existing generic_local_types symbols; the added zero-size test file passes directly.

@cpunion cpunion force-pushed the codex/goroot-fixedbugs-zeroderef branch from 5493532 to 4068ae5 Compare May 24, 2026 14:01
@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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