Closed kroppt closed 4 years ago
Error:
panic: cannot do unary on: &ast.BinaryOperator{Addr:0x56227c605798, Pos:ast.Position{File:"/home/user/code/c2gotest/c/code.c", Line:2, LineEnd:0, Column:18, ColumnEnd:22, StringValue:""}, Type:"int", Type2:"", Operator:"+", ChildNodes:[]ast.Node{(*ast.IntegerLiteral)(0xc00019c880), (*ast.IntegerLiteral)(0xc00019c900)}} goroutine 1 [running]: github.com/elliotchance/c2go/transpiler.transpileUnaryExprOrTypeTraitExpr(0xc0001ac6e0, 0xc000238000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...) /home/user/code/c2go/transpiler/unary.go:730 +0x4ee github.com/elliotchance/c2go/transpiler.transpileToExpr(0x711e40, 0xc0001ac6e0, 0xc000238000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8dd368, 0x0, ...) /home/user/code/c2go/transpiler/transpiler.go:203 +0x364 github.com/elliotchance/c2go/transpiler.transpileImplicitCastExpr(0xc0001ac500, 0xc000238000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...) /home/user/code/c2go/transpiler/cast.go:41 +0x1a7 github.com/elliotchance/c2go/transpiler.transpileToExpr(0x711340, 0xc0001ac500, 0xc000238000, 0xc000046700, 0x0, 0x0, 0x0, 0x0, 0x8dd368, 0x0, ...) /home/user/code/c2go/transpiler/transpiler.go:179 +0x878 github.com/elliotchance/c2go/transpiler.transpileReturnStmt(0xc0001a8b40, 0xc000238000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...) /home/user/code/c2go/transpiler/functions.go:337 +0xe5 github.com/elliotchance/c2go/transpiler.transpileToStmt(0x711b40, 0xc0001a8b40, 0xc000238000, 0x0, 0x0, 0x8dd368, 0x0, 0x0, 0x8dd368, 0x0, ...) /home/user/code/c2go/transpiler/transpiler.go:349 +0xf4a github.com/elliotchance/c2go/transpiler.transpileToStmts(0x711b40, 0xc0001a8b40, 0xc000238000, 0x8dd368, 0x0, 0x0, 0x0, 0x0) /home/user/code/c2go/transpiler/transpiler.go:270 +0xdf github.com/elliotchance/c2go/transpiler.transpileCompoundStmt(0xc0003c3500, 0xc000238000, 0x0, 0x8, 0x100000400000000, 0xffffffffffffffff, 0x1, 0xc000046ca8, 0x30000000066ada0, 0xffffffffffffffff, ...) /home/user/code/c2go/transpiler/scope.go:21 +0xbb github.com/elliotchance/c2go/transpiler.transpileToStmt(0x710ac0, 0xc0003c3500, 0xc000238000, 0x0, 0x0, 0x8dd368, 0x0, 0x0, 0x8dd368, 0x0, ...) /home/user/code/c2go/transpiler/transpiler.go:352 +0xb98 github.com/elliotchance/c2go/transpiler.transpileToStmts(0x710ac0, 0xc0003c3500, 0xc000238000, 0x8dd368, 0x0, 0x0, 0x0, 0x0) /home/user/code/c2go/transpiler/transpiler.go:270 +0xdf github.com/elliotchance/c2go/transpiler.transpileToBlockStmt(0x710ac0, 0xc0003c3500, 0xc000238000, 0x4, 0xc000383288, 0x8dd301, 0x0, 0x0, 0x0, 0x0, ...) /home/user/code/c2go/transpiler/scope.go:38 +0x43 github.com/elliotchance/c2go/transpiler.transpileFunctionDecl(0xc000196820, 0xc000238000, 0x0, 0x0, 0x0, 0x0, 0x0) /home/user/code/c2go/transpiler/functions.go:86 +0x287d github.com/elliotchance/c2go/transpiler.transpileToNode(0x711140, 0xc000196820, 0xc000238000, 0x0, 0x0, 0x0, 0x0, 0x0) /home/user/code/c2go/transpiler/transpiler.go:448 +0x308 github.com/elliotchance/c2go/transpiler.transpileTranslationUnitDecl(0xc000238000, 0xc000098260, 0x0, 0x0, 0x0, 0x0, 0x0) /home/user/code/c2go/transpiler/translation_unit.go:116 +0x153 github.com/elliotchance/c2go/transpiler.transpileToNode(0x711d00, 0xc000098260, 0xc000238000, 0x0, 0x0, 0x0, 0x0, 0x0) /home/user/code/c2go/transpiler/transpiler.go:445 +0xbce github.com/elliotchance/c2go/transpiler.TranspileAST(0x0, 0x0, 0x6b0360, 0x4, 0xc000238000, 0x711d00, 0xc000098260, 0x19, 0x19) /home/user/code/c2go/transpiler/transpiler.go:32 +0x1a1 main.Start(0x0, 0xc0000101a0, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6b0360, ...) /home/user/code/c2go/main.go:297 +0xf0c main.runCommand(0xc000064058) /home/user/code/c2go/main.go:429 +0x42c main.main() /home/user/code/c2go/main.go:352 +0x22
clang:
~ $ clang --version clang version 10.0.0 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/lib/llvm/10/bin
Source: https://c-testsuite.github.io/c2go_report.html
Test file:
int main() { return sizeof(1 + 1); }
Error:
clang:
Source: https://c-testsuite.github.io/c2go_report.html
Test file: