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

panic: unknown node type: MSAllocatorAttr #859

Open
NaniteFactory opened this issue Jun 18, 2020 · 0 comments
Open

panic: unknown node type: MSAllocatorAttr #859

NaniteFactory opened this issue Jun 18, 2020 · 0 comments

Comments

@NaniteFactory
Copy link

NaniteFactory commented Jun 18, 2020

Transpile panic

Command:

c2go transpile prime.c

Result:

panic: unknown node type: 'MSAllocatorAttr 0x28201f4a260 <line:187:25>'

goroutine 100 [running]:
github.com/elliotchance/c2go/ast.Parse(0xc000556983, 0x2b, 0x6dc877, 0x5)
        E:/GoPath/src/github.com/elliotchance/c2go/ast/ast.go:294 +0x4548
main.convertLinesToNodes(0xc0000d4000, 0x18a, 0x18a5, 0x0, 0x0, 0x0)
        E:/GoPath/src/github.com/elliotchance/c2go/main.go:89 +0x1ad
main.convertLinesToNodesParallel.func1.1(0xc00020c0c0, 0xc000006028, 0xc0000d4000, 0x18a, 0x18a5, 0x0)
        E:/GoPath/src/github.com/elliotchance/c2go/main.go:113 +0x5a
created by main.convertLinesToNodesParallel.func1
        E:/GoPath/src/github.com/elliotchance/c2go/main.go:111 +0x12b

Environment:

go version go1.13.7 windows/amd64
clang version 10.0.0
Target: x86_64-pc-windows-msvc
Thread model: posix
  • LLVM 10.0 is installed.

Source and AST

Source:

#include <stdio.h>
 
int main()
{
   int n, c;
 
   printf("Enter a number\n");
   scanf("%d", &n);
 
   if ( n == 2 )
      printf("Prime number.\n");
   else
   {
       for ( c = 2 ; c <= n - 1 ; c++ )
       {
           if ( n % c == 0 )
              break;
       }
       if ( c != n )
          printf("Not prime.\n");
       else
          printf("Prime number.\n");
   }
   return 0;
}

AST: ast.txt (file attatched)

c2go ast prime.c > ast.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant