Regenerated all out.ll files after reinstalling llgen to fix TestFromTestrt and TestFromTestgo test failures.
Updated files:
- cl/_testgo/equal/out.ll
- cl/_testrt/asmfull/out.ll
- cl/_testrt/makemap/out.ll
- cl/_testrt/tpmap/out.ll
The changes correctly update interface PkgPath from specific package paths to empty strings (zeroinitializer) for interfaces with only exported methods, which aligns with the fix in PR #1380 for issue #1370.
🤖 Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
Reverted two unnecessary formatting changes based on code review:
- ssa/interface.go: Restored single-line format for val function
- ssa/abitype.go: Moved pkg variable declaration back to original position
These changes don't affect functionality, just code formatting.
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
Based on meeting discussion, this commit reverts the previous approach
of extracting PkgPath from interface methods. Instead, anonymous
interfaces now use an empty PkgPath string, and the runtime's methods()
function handles empty PkgPath by returning all methods.
Changes:
- Reverted unsafeInterface() to remove originType parameter
- Set anonymous interface PkgPath to empty string in abitype.go:202
- Added early return in methods() in z_face.go for empty PkgPath
- All call sites of unsafeInterface() updated to pass rawIntf directly
This approach is cleaner because anonymous interfaces don't belong to
any package, and the compiler already guarantees safety for cross-package
private method access.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
Fixes#1370 - Segmentation Fault When Calling Interface Private Methods Cross-Package
This commit fixes a critical bug where interface metadata's PkgPath was incorrectly
set when converting concrete type pointers to interfaces with private methods across
package boundaries.
Problem:
- When a concrete type pointer was converted to an interface with private methods
in a package different from the interface definition package, the compiler
incorrectly set the interface metadata's PkgPath to the current compilation
package instead of the interface definition package
- This caused the runtime to only fill exported methods in the itab, leaving
private method slots as NULL (0x0), resulting in segmentation faults
Solution:
- Modified abiInterfaceOf() in ssa/abitype.go to extract the package path from
the interface's private methods (if any)
- Use that package path instead of the current compilation package path
- Fall back to current package path only if all methods are exported
Changes:
- ssa/abitype.go: Use abi.PathOf() to get correct package path
- ssa/interface.go: Refactor to simplify interface type handling
- Added comprehensive test cases and demos for go/types, go/token, and go/ast
- Updated all test outputs to reflect correct interface metadata generation
This fix resolves segmentation faults when using Go standard library interfaces
and user-defined interfaces with private methods across package boundaries.
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
Update README to reflect that hash/maphash package has been mostly
implemented and verified by adding it to the Go packages support
section with "(partially)" status.
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <luoliwoshang@users.noreply.github.com>
Add !xgopilot/** exclusion pattern to all workflow trigger configurations,
matching the existing dependabot pattern. This ensures that xgopilot branches
only trigger CI checks on pull_request events, eliminating redundant push
event triggers.
Fixes#1340🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fix line 67: Change unused variable 'n' to blank identifier '_'
- Fix line 102: Correct WriteByte call to expect only error return value
(WriteByte returns only error, not (int, error))
These fixes resolve the compilation errors reported by the CI.
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <luoliwoshang@users.noreply.github.com>
- Add tests for all major hash/maphash public APIs:
* Hash basics (WriteString, Sum64, Reset)
* MakeSeed and SetSeed functionality
* Write methods (Write, WriteByte, WriteString)
* Bytes and String convenience functions
- Use panic() for unexpected errors instead of silent failures
- Add proper error checking and validation
- Document Comparable/WriteComparable limitations in overlay
Note: Comparable() and WriteComparable() are not yet supported and will
panic with 'intrinsic' error as they require runtime intrinsic support.
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <luoliwoshang@users.noreply.github.com>
Implement randUint64() directly in the maphash overlay to ensure compatibility
across Go versions. Go 1.21's randUint64() calls runtime.fastrand64, while
Go 1.22+ calls runtime.rand. The wrapper function bridges to llgo's fastrand64
implementation, avoiding undefined symbol errors on Go 1.21.
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <luoliwoshang@users.noreply.github.com>
The llgo:skipall directive was preventing fallback to the standard library,
causing undefined symbol errors for functions like WriteString, MakeSeed, etc.
The overlay now only defines the two linkname functions, allowing typepatch
to handle the rest.
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <luoliwoshang@users.noreply.github.com>
Move runtime_rand and runtime_memhash linkname declarations from
runtime/internal/lib/runtime/runtime.go to runtime/internal/lib/hash/maphash/maphash.go
to avoid polluting the runtime package namespace.
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <luoliwoshang@users.noreply.github.com>
- Register hash/maphash in hasAltPkg map in runtime/build.go
- Add rand() function that bridges to fastrand64() in runtime overlay
- Add memhash() function that bridges to internal memhash() in runtime overlay
- Fixes issue where hash/maphash package failed with undefined symbols
Fixes#1338
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <luoliwoshang@users.noreply.github.com>
Co-authored-by: xgopilot <noreply@goplus.org>
- Add 'Build llgo command specifically' and 'Check llgo version' commands
- Consolidate all build-related commands in one section
- Reduce redundancy by having single section for development tasks
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: xgopilot <noreply@goplus.org>
- Add requirement to run formatting before submitting code updates
- Emphasize that go fmt must be run before committing changes
- Clarify that formatting ensures consistent code formatting
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: xgopilot <noreply@goplus.org>
- Remove 'Validated Commands and Expected Outputs' section (lines 71-95)
- This information is already covered in 'Validation Workflow' section
- Reduces redundancy and improves document clarity
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: xgopilot <noreply@goplus.org>
- Move demo examples to Project Structure with simplified descriptions
- Change 'Test a simple example' to focus on writing and running test cases
- Remove standalone Running Examples section to reduce redundancy
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: xgopilot <noreply@goplus.org>
- Combines Testing and Validation sections for better organization
- Emphasizes these steps are essential when fixing bugs or implementing features
- Maintains all validation information with clearer structure
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: xgopilot <noreply@goplus.org>
- Link Development Environment section to README to avoid redundancy
- Remove 'Verified Environment' subsection
- Remove 'Build pydump' section as not needed for current doc
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: xgopilot <noreply@goplus.org>
- Update _cmptest/ description to clarify its purpose
- Remove scattered 'Verified output' sections
- Consolidate all validation information into unified Validation section
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: xgopilot <noreply@goplus.org>