WONKY



LOG | FILES | OVERVIEW


F diff --git a/src/program/program.c b/src/program/program.c --- a/src/program/program.c +++ b/src/program/program.c
ret->source_files=malloc(sizeof(struct Queue));
ret->errors=malloc(sizeof(struct Queue));
ret->types=malloc(sizeof(struct Map));
- ret->external_linkage=malloc(sizeof(struct Linkage));
+ ret->external_linkage=get_linkage();
Queue_Init(ret->translation_units);
Queue_Init(ret->source_files);
F diff --git a/src/semantics/ast.c b/src/semantics/ast.c --- a/src/semantics/ast.c +++ b/src/semantics/ast.c
}
void delete_ast_goto_statemtent(struct AST_Goto_Statement *goto_statement)
{
- if(goto_statement->label!=NULL)
- free(goto_statement->label);
free(goto_statement);
}
void delete_ast_switch_statement(struct AST_Switch_Statement *switch_statement)
F diff --git a/src/semantics/identifiers/denoted.c b/src/semantics/identifiers/denoted.c --- a/src/semantics/identifiers/denoted.c +++ b/src/semantics/identifiers/denoted.c
while(statement->gotos_jumping_to_this_statement->size>0)
Queue_Pop(statement->gotos_jumping_to_this_statement);
}
+ free(statement->gotos_jumping_to_this_statement);
free(statement);
}
void delete_denoted_wrapper(void *denoted)
F diff --git a/src/semantics/identifiers/scope.c b/src/semantics/identifiers/scope.c --- a/src/semantics/identifiers/scope.c +++ b/src/semantics/identifiers/scope.c
struct Scope* get_normal_scope(struct Scope *parent,enum Scope_Type type)
{
struct Normal_Scope *ret;
+
assert(type==BLOCK_SCOPE || type==FILE_SCOPE || type==FUNCTION_PROTOTYPE_SCOPE);
+
ret=malloc(sizeof(struct Normal_Scope));
ret->type=type;
ret->parent=parent;
Map_Init(&ret->tags);
+
+
Map_Init(&ret->ordinary);
+
+
+
ret->object_order=malloc(sizeof(struct Queue));
+
+
Queue_Init(ret->object_order);
return (struct Scope*)ret;
Map_Destroy(&scope->tags);
Map_Map(&scope->ordinary,delete_denoted_with_no_linkage_wrapper);
Map_Destroy(&scope->ordinary);
+ while(scope->object_order->size>0)
+ Queue_Pop(scope->object_order);
+ free(scope->object_order);
free(scope);
}
{
Map_Map(&scope->labels,delete_denoted_wrapper);
Map_Destroy(&scope->labels);
+ while(scope->label_order->size>0)
+ Queue_Pop(scope->label_order);
+ free(scope->label_order);
free(scope);
}