Skip to content

C frontend recursive struct parsing #459

@csanadtelbisz

Description

@csanadtelbisz

Recursive structs cannot be parsed correctly, e.g., try this:

extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;

typedef struct Node {
  int data;
  struct Node* next;
} Node;

int main() {
  Node* newNode = (Node*) malloc(sizeof(Node));
  newNode->next = NULL;
  return 0;
}

It is because merge mergeCTypes does not correctly finds out what is the mainType at the referenced location. As a result, an exception occurs in NamedType::patch. mergeCTypes or NamedType::patch should be fixed.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions