From 858b0dc8ace2f938db75dcd0c31098a7704a6995 Mon Sep 17 00:00:00 2001 From: Jerome St-Louis Date: Thu, 18 Apr 2013 16:40:10 -0400 Subject: [PATCH] compiler/libec: Fixed a leak and missing 'return' --- compiler/bootstrap/libec/bootstrap/ast.c | 3 +-- compiler/libec/locale/ec.pot | 4 ++-- compiler/libec/src/ast.ec | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/compiler/bootstrap/libec/bootstrap/ast.c b/compiler/bootstrap/libec/bootstrap/ast.c index 292a014..764bc1d 100644 --- a/compiler/bootstrap/libec/bootstrap/ast.c +++ b/compiler/bootstrap/libec/bootstrap/ast.c @@ -2109,7 +2109,6 @@ break; if(!spec) { ListAdd(qualifiers, MkSpecifierName(decl->identifier->string)); -decl->identifier->string = (((void *)0)); FreeDeclarator(decl); parentDecl->declarator = (((void *)0)); } @@ -2703,7 +2702,7 @@ struct FunctionDefinition * _MkFunction(struct __ecereNameSpace__ecere__sys__Old struct FunctionDefinition * MkFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * declarationList) { -_MkFunction(specifiers, declarator, declarationList, 0x1); +return _MkFunction(specifiers, declarator, declarationList, 0x1); } extern struct Declarator * GetFuncDecl(struct Declarator * decl); diff --git a/compiler/libec/locale/ec.pot b/compiler/libec/locale/ec.pot index 65474d8..3426b87 100644 --- a/compiler/libec/locale/ec.pot +++ b/compiler/libec/locale/ec.pot @@ -48,7 +48,7 @@ msgstr "Couldn't find member %s to override\n" msgid "Couldn't open %s\n" msgstr "Couldn't open %s\n" -#: ./src/ast.ec:1649 +#: ./src/ast.ec:1648 msgid "Expecting class specifier\n" msgstr "Expecting class specifier\n" @@ -130,7 +130,7 @@ msgstr "Recursion in defined expression %s\n" msgid "Redefinition of %s (defining as %s, already defined as %s)\n" msgstr "Redefinition of %s (defining as %s, already defined as %s)\n" -#: ./src/ast.ec:794 +#: ./src/ast.ec:793 msgid "Redefinition of %s ignored\n" msgstr "Redefinition of %s ignored\n" diff --git a/compiler/libec/src/ast.ec b/compiler/libec/src/ast.ec index 21ce91c..27e523a 100644 --- a/compiler/libec/src/ast.ec +++ b/compiler/libec/src/ast.ec @@ -635,7 +635,6 @@ public TypeName MkTypeName(OldList qualifiers, Declarator declarator) { // This is actually a type ListAdd(qualifiers, MkSpecifierName(decl.identifier.string)); - decl.identifier.string = null; FreeDeclarator(decl); parentDecl.declarator = null; } @@ -1109,7 +1108,7 @@ Statement MkReturnStmt(OldList exp) FunctionDefinition MkFunction(OldList specifiers, Declarator declarator, OldList declarationList) { - _MkFunction(specifiers, declarator, declarationList, true); + return _MkFunction(specifiers, declarator, declarationList, true); } FunctionDefinition _MkFunction(OldList specifiers, Declarator declarator, OldList declarationList, bool errorOnOmit) -- 1.8.3.1