elliotchance / c2go

⚖️ A tool for transpiling C to Go.
MIT License
2.06k stars 151 forks source link

panic: unknown node type: 'MSAllocatorAttr 0x21a234729f0 <line:420:25>' #873

Open yanmingsohu opened 3 years ago

yanmingsohu commented 3 years ago

Parse this file: https://github.com/rscada/libmbus/blob/master/mbus/mbus-protocol.c

panic: unknown node type: 'MSAllocatorAttr 0x21a234729f0 <line:420:25>'

goroutine 9463 [running]:
github.com/elliotchance/c2go/ast.Parse(0xc000d4ef8d, 0x2b, 0x6dc8db, 0x5)
        D:/go-projects/src/github.com/elliotchance/c2go/ast/ast.go:294 +0x4548
main.convertLinesToNodes(0xc00028c510, 0x2, 0x6509, 0x0, 0x0, 0x0)
        D:/go-projects/src/github.com/elliotchance/c2go/main.go:89 +0x1ad
main.convertLinesToNodesParallel.func1.1(0xc0064e9aa0, 0xc000304000, 0xc00028c510, 0x2, 0x6509, 0x0)
        D:/go-projects/src/github.com/elliotchance/c2go/main.go:113 +0x5a
created by main.convertLinesToNodesParallel.func1
        D:/go-projects/src/github.com/elliotchance/c2go/main.go:111 +0x12b
clang version 10.0.0
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: D:\_dev_tool\LLVM-10.0.0-win64\bin
leekinzeng commented 3 years ago

same question:

Parse this file: https://github.com/elliotchance/c2go/tree/master/examples/prime.c

panic: unknown node type: 'ColdAttr 0x7fd9300a35b8 '

goroutine 24 [running]: github.com/elliotchance/c2go/ast.Parse(0xc0003529f1, 0x20, 0x12add34, 0x5) /Users/liqinzheng/Go/src/github.com/elliotchance/c2go/ast/ast.go:294 +0x3412 main.convertLinesToNodes(0xc00035db80, 0xdc, 0x1b9, 0x0, 0x0, 0x0) /Users/liqinzheng/Go/src/github.com/elliotchance/c2go/main.go:89 +0x1a6 main.convertLinesToNodesParallel.func1.1(0xc00019a3c0, 0xc000180090, 0xc00035db80, 0xdc, 0x1b9, 0x0) /Users/liqinzheng/Go/src/github.com/elliotchance/c2go/main.go:113 +0x53 created by main.convertLinesToNodesParallel.func1 /Users/liqinzheng/Go/src/github.com/elliotchance/c2go/main.go:111 +0x12a

Apple clang version 11.0.0 (clang-1100.0.33.17) Target: x86_64-apple-darwin19.5.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin