Skip to content

fix: example avalue pointer bug + CI examples check (v0.5.5)#57

Merged
kolkov merged 1 commit into
mainfrom
fix/example-avalue-ci
Jun 15, 2026
Merged

fix: example avalue pointer bug + CI examples check (v0.5.5)#57
kolkov merged 1 commit into
mainfrom
fix/example-avalue-ci

Conversation

@kolkov

@kolkov kolkov commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix examples/simple/main.go: avalue elements must be pointers TO argument values, not values directly. Darwin path was correct, Windows/Linux path was not
  • Add examples build verification to CI — all examples/*/go.mod compiled in cross-compile job

Bug

// WRONG (crashed on Windows 11 ARM64):
arg := unsafe.Pointer(unsafe.StringData(str))
args := []unsafe.Pointer{arg}                    // value directly ❌

// CORRECT:
cstr := unsafe.Pointer(unsafe.StringData(str))
args := []unsafe.Pointer{unsafe.Pointer(&cstr)}  // pointer TO value ✅

Reported by @lkmavi on Windows 11 ARM64 (Snapdragon).

Test plan

  • examples/simple/ compiles locally
  • Main module builds and tests pass
  • CI green (includes new examples build check)

Closes: reported via chat, no GitHub issue

Fix examples/simple/main.go: avalue elements must be pointers TO
argument values (unsafe.Pointer(&cstr)), not values directly.
The Darwin path was correct, Windows/Linux path was not.

Add examples build verification to CI cross-compile job —
iterates all examples/*/go.mod and runs go build.
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@kolkov kolkov merged commit 18b6e5a into main Jun 15, 2026
13 checks passed
@kolkov kolkov deleted the fix/example-avalue-ci branch June 15, 2026 20:46
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.

1 participant