solved segfault
This commit is contained in:
parent
5eded1aa20
commit
c53c3c33f3
|
@ -307,8 +307,9 @@ int createRef(AST_NODE_PTR currentNode, Type** reftype) {
|
||||||
|
|
||||||
|
|
||||||
Type * type = malloc(sizeof(Type));
|
Type * type = malloc(sizeof(Type));
|
||||||
(*reftype)->kind = TypeKindReference;
|
Type * referenceType = malloc(sizeof(Type));
|
||||||
(*reftype)->nodePtr = currentNode;
|
referenceType->kind = TypeKindReference;
|
||||||
|
referenceType->nodePtr = currentNode;
|
||||||
|
|
||||||
|
|
||||||
int signal = get_type_impl(currentNode->children[0],&type);
|
int signal = get_type_impl(currentNode->children[0],&type);
|
||||||
|
@ -316,8 +317,8 @@ int createRef(AST_NODE_PTR currentNode, Type** reftype) {
|
||||||
//TODO free type
|
//TODO free type
|
||||||
return SEMANTIC_ERROR;
|
return SEMANTIC_ERROR;
|
||||||
}
|
}
|
||||||
(*reftype)->impl.reference = type;
|
referenceType->impl.reference = type;
|
||||||
|
*reftype = referenceType;
|
||||||
return SEMANTIC_OK;
|
return SEMANTIC_OK;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue