xgopilot
210d8858d5
chore: regenerate out.ll files with llgen after interface changes
...
Regenerated all out.ll test files using llgen after the interface
metadata changes. The updated files now reflect:
- Anonymous interfaces use empty PkgPath (zeroinitializer)
- Anonymous interface types have unique identifiers
- Runtime correctly handles empty PkgPath for method visibility
Files regenerated:
- cl/_testgo/errors/out.ll
- cl/_testgo/ifaceconv/out.ll
- cl/_testgo/ifaceprom/out.ll
- cl/_testgo/interface/out.ll
- cl/_testgo/interface1370/out.ll
- cl/_testgo/invoke/out.ll
- cl/_testgo/reader/out.ll
- cl/_testgo/reflect/out.ll
- cl/_testgo/tpinst/out.ll
- cl/_testrt/tpabi/out.ll
- cl/_testrt/tpmethod/out.ll
- cl/_testrt/vamethod/out.ll
Generated with [codeagent](https://github.com/qbox/codeagent )
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com >
2025-10-30 07:53:06 +00:00
xgopilot
88d32c9930
fix(ssa): correct PkgPath for interface metadata in cross-package conversions
...
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 >
2025-10-30 06:24:23 +00:00
visualfc
5592a8fc26
ssa: fix abiTupleOf
2025-09-25 20:16:44 +08:00
visualfc
56f90dbcf9
ssa: fix TypeAssert check null
2025-08-08 12:11:17 +08:00
luoliwoshang
6e8f3d1d19
test(build):collect llgo test ./... output to test
2025-06-25 15:38:20 +08:00
xushiwei
e9c96390e6
Merge pull request #1151 from luoliwoshang/internal/build/testdir
...
internal/build:switch workdir from testpkg like go behavior
2025-06-22 15:26:07 +08:00
visualfc
2118849d27
cl/_testgo/reflectmkfn
2025-06-13 09:13:48 +08:00
luoliwoshang
48bd1d46af
internal/build:switch workdir from testpkg like go behavior
2025-06-12 16:49:40 +08:00
visualfc
cfc8687851
lib/reflect: fix closure pointer
2025-05-16 12:00:59 +08:00
visualfc
c4f0dd124d
cl: funcName check $bound
2025-05-15 21:12:18 +08:00
visualfc
e8a91696d6
go.mod go1.23
2025-05-05 10:19:23 +08:00
Li Jie
c8d791f206
fix llgo test unit test
2025-04-03 16:32:46 +08:00
Li Jie
ed366568b4
move out c/cpp/py
2025-04-03 16:26:11 +08:00
Li Jie
1172e5bdce
build: separate compiler and libs
2025-01-08 14:59:01 +08:00
Li Jie
03b469212e
feat: upgrade to x/tools 0.28
2025-01-08 14:58:59 +08:00
visualfc
a6a3c09c05
ssa: closure use specific struct field name { $f ftype, $data unsafe.pointer }
2024-12-22 12:44:33 +08:00
visualfc
ef28abe896
internal/runtime: funcStr, interfaceStr, array str
2024-12-20 12:33:34 +08:00
visualfc
d251232f8a
internal/runtime: named(ptr) type preset for method type
2024-12-20 11:37:30 +08:00
xushiwei
b4af70ada9
Merge pull request #916 from visualfc/runtime.interface
...
abi: fix named interface init
2024-12-17 14:43:15 +08:00
visualfc
e55a5d7486
internal/runtime: NewNamedInterface, InitNamedInterface
2024-12-16 12:07:13 +08:00
xushiwei
29ad96862f
Merge pull request #628 from visualfc/go
...
ssa: fix ssa.go for builtin
2024-12-14 06:44:35 +08:00
七叶
3505be422e
Revert "ssa: defer load/store func and args"
2024-12-03 21:00:49 +08:00
visualfc
7eeb8084bf
ssa: fix ssa.go for builtin
2024-12-02 15:40:56 +08:00
visualfc
6e8cecd13e
cl/_testgo: defer6
2024-12-02 11:43:20 +08:00
Li Jie
c3407eac5e
cgo: supports //export functions only calls in C
2024-11-27 20:24:53 +08:00
Li Jie
e46b3e24d6
test: move cgo demo into _testgo, and make links
2024-11-27 18:41:56 +08:00
Li Jie
90763de93c
cgo: supports c/go callback funcs
2024-11-27 18:41:56 +08:00
Li Jie
c9f436cc47
cgo: full test
...
cgo: test returning void
2024-11-27 18:41:56 +08:00
visualfc
91b46b05ad
cl/_testgo/reflect: map demo
2024-11-27 11:31:28 +08:00
Li Jie
954cc0e8bc
test: ignore syncmap since different pthread_mutex_t size on macOS and linux
2024-11-26 13:21:33 +08:00
Li Jie
ad48325dff
test: regenerate test fixtures
2024-11-26 13:21:01 +08:00
visualfc
c2138037d2
internal/lib/reflect: call variadic check
2024-11-26 12:46:11 +08:00
visualfc
fadd64c1e9
ssa: cvtClosure remove closureCtx param
2024-11-26 12:46:11 +08:00
Li Jie
6099369019
test: update generated code
2024-11-25 11:18:46 +08:00
xushiwei
8d2b65386c
Merge pull request #874 from cpunion/fix-closure
...
ssa: fix wrong reflect type of closure
2024-11-25 11:05:04 +08:00
Li Jie
43c1bc8d5f
ssa: compile go string constant without alloca
2024-11-24 15:29:20 +08:00
Li Jie
17832fe18c
ssa: fix type of ChanOp.Size
2024-11-24 15:21:32 +08:00
Li Jie
252f3f0bd6
ssa: fix closure type
2024-11-24 10:54:00 +08:00
visualfc
e6de8401bf
internal/lib/reflect: makeMethodValue
2024-11-19 20:51:08 +08:00
visualfc
df2e34ac51
internal/lib/reflect: call.method
2024-11-19 20:51:08 +08:00
visualfc
7bbd3a7e36
internal/lib/reflect: TypeOf check closure
2024-11-19 20:51:07 +08:00
visualfc
6b0122547e
reflect.call: internal/abi: TFlagClosure, internal/lib/reflect: flagClosure.
2024-11-01 15:27:40 +08:00
visualfc
ce87f293aa
ssa: fix map key has typeargs
2024-10-30 20:22:05 +08:00
visualfc
dca028a84f
ssa: fix goTypes.cvtNamed recurs for typeargs
2024-10-30 20:22:05 +08:00
visualfc
2b5fdd3548
ssa: fix closure type
2024-10-29 20:50:02 +08:00
xushiwei
ae8ad3b68b
Merge pull request #837 from cpunion/const-conv
...
ssa: fix int constant type conversion
2024-10-23 10:58:08 +08:00
Li Jie
7d7d4db329
ssa: fix int constant type conversion
2024-10-21 18:50:32 +08:00
visualfc
d62c2d913e
ssa: abi check interface method
2024-10-12 15:59:10 +08:00
visualfc
9eb9b48534
internal/lib/reflect: type.Field FieldByIndex FieldByName
2024-09-22 20:56:15 +08:00
Li Jie
d85a080f9b
ssa: support string and pointer debug info, fix params debugging
2024-09-18 21:14:04 +08:00