Skip to content

Fix generic unsafe.Sizeof arithmetic#1913

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

Fix generic unsafe.Sizeof arithmetic#1913
cpunion wants to merge 1 commit into
xgo-dev:mainfrom
cpunion:codex/goroot-constexpr-coverage

Conversation

@cpunion
Copy link
Copy Markdown
Collaborator

@cpunion cpunion commented May 24, 2026

Summary

  • return a uintptr-typed SSA value for generic unsafe.Sizeof builtin lowering
  • keep divide-by-zero guard panics as runtime errors so recover observes error/RuntimeError
  • add test/go coverage for generic unsafe.Sizeof shift/add/div arithmetic and unxfail fixedbugs/issue60601.go

Tests

  • go test ./test/goroot -run TestGoRootRunCases -count=1 -timeout=10m -args -goroot /Users/lijie/sdk/go1.26.0 -dirs fixedbugs -case '^fixedbugs/issue60601\.go$' -directive-mode runlike -xfail /tmp/llgo-empty-xfail.yaml\n- go test ./test/go -count=1\n- go run ./cmd/llgo test ./test/go -run TestGenericUnsafeSizeofArithmetic -count=1\n- go test ./ssa -count=1\n- go test ./internal/build -count=1\n- (cd runtime && go test ./internal/runtime -count=1)\n- go test ./cl -count=1 -timeout=10m\n

@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