- Add z_rt_default.go with signal handler for SIGSEGV on non-wasm platforms
- Convert segmentation faults from nil pointer access to Go panic
- Enable recover() to catch nil pointer dereference errors
- Use build tag (!wasm) to maintain wasm platform compatibility
- Remove commented-out signal handling code from z_rt.go
This aligns llgo's behavior with standard Go, where accessing nil pointer
fields triggers a recoverable panic instead of immediate program crash.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Updated the out.ll update workflow to document both tools:
- gentests: batch regeneration of all test files (recommended)
- llgen: individual test directory regeneration (for inspection)
Verified gentests works correctly by testing the regeneration
of all out.ll files. The tool successfully processes all
non-Python test directories.
🤖 Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
Add comprehensive documentation explaining:
- What out.ll files are (IR comparison test files)
- When to update them (after modifying IR generation logic)
- How to update them (reinstall llgen, regenerate files)
- Why this matters (test consistency and regression detection)
This documentation will help avoid wasting time on repeatedly updating
test files, as it clarifies the required workflow when making compiler
changes that affect IR generation.
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
- Moved test from _cmptest/reflect_indirect/ to _demo/go/reflect-indirect/
- Refactored to use panic() for validation instead of fmt.Println
- Added proper assertions for all test cases
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <luoliwoshang@users.noreply.github.com>
Implements reflect.Indirect function to support pointer dereferencing.
This function returns the value that a pointer points to, or returns
the value unchanged if it's not a pointer.
Fixes#1354
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <luoliwoshang@users.noreply.github.com>
The CompareString in the llgo:skip directive is redundant because
the overlay mechanism automatically handles symbol skipping when
an overlay package defines a symbol.
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <luoliwoshang@users.noreply.github.com>
Use go:linkname to access build.Default and modify Compiler in init function.
This is much simpler than patching defaultContext() and all its dependencies.
- Reduced from 137 lines to 27 lines
- Removed zcgo.go (no longer needed)
- Removed complex parseGoVersion, defaultContext, and helper functions
- Now just sets build.Default.Compiler = "gc" in init()
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <luoliwoshang@users.noreply.github.com>
Enhanced the demo test to cover comprehensive import scenarios:
- Test 1: build.Default context with GOOS/GOARCH validation
- Test 2: Standard library package import (fmt)
- Test 3: Nested standard library package (os/exec)
- Test 4: Internal package import (internal/cpu)
- Test 5: Runtime package with Dir validation
- Test 6: ImportDir with current directory
- Test 7: IsLocalImport with multiple path formats
- Test 8: Context GOPATH/GOROOT validation
- Test 9: Import with AllowBinary flag
- Test 10: Release tags validation
All tests include proper result validation to ensure go/build
patches work correctly across different use cases.
🤖 Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <luoliwoshang@users.noreply.github.com>