Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llgo cmptest : Unexpected panic when running from project root for specific directory #895

Open
luoliwoshang opened this issue Nov 29, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@luoliwoshang
Copy link
Contributor

luoliwoshang commented Nov 29, 2024

When executing llgo cmptest ./_xtool/llcppsymg/_cmptest/... from the goplus/llcppg project root directory, an unexpected panic occurs:

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/goplus/llgo/internal/build.Do({0x140000ac1a0?, 0x1?, 0x1?}, 0x140000ca5a0)
        /Users/zhangzhiyang/go/pkg/mod/github.com/goplus/[email protected]/internal/build/build.go:196 +0xd70
...

However, the same test command works fine in two scenarios:

  1. When executed directly in the ./_xtool/llcppsymg/_cmptest/ directory
  2. When running similar tests for llcppsigfetch from the project root (e.g., llgo cmptest ./_xtool/llcppsigfetch/parse/cvt_test/...)

Steps to Reproduce:

  1. From project root:
llgo cmptest ./_xtool/llcppsymg/_cmptest/...  # Fails with panic
  1. From ./_xtool/llcppsymg/_cmptest/ directory:
llgo cmptest ./...  # Works correctly
  1. From project root (different module):
llgo cmptest ./_xtool/llcppsigfetch/parse/cvt_test/...  # Works correctly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants