From: Nick Bowler Date: Tue, 4 Oct 2011 01:24:49 +0000 (-0400) Subject: Don't call cdecl_free internally. X-Git-Tag: v1~88 X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/commitdiff_plain/dd0e33293dca1f19fd465b4d96b64adb6444e0d2 Don't call cdecl_free internally. Use an exported wrapper function to avoid a local PLT entry in the shared object. --- diff --git a/src/parse-decl.c b/src/parse-decl.c index 0d26b9d..e5395b4 100644 --- a/src/parse-decl.c +++ b/src/parse-decl.c @@ -430,7 +430,7 @@ struct cdecl *cdecl_parse_decl(const char *declstr) return decl; err: - cdecl_free(decl); + cdecl__free(decl); return NULL; } @@ -469,6 +469,11 @@ struct cdecl *cdecl_parse_english(const char *english) return decl; err: - cdecl_free(decl); + cdecl__free(decl); return NULL; } + +void cdecl_free(struct cdecl *decl) +{ + cdecl__free(decl); +} diff --git a/src/parse.y b/src/parse.y index 5bcd9a9..3f02129 100644 --- a/src/parse.y +++ b/src/parse.y @@ -57,6 +57,7 @@ } %code provides { +void cdecl__free(struct cdecl *); void cdecl__yyerror(YYLTYPE *, void *, struct cdecl **, const char *); int cdecl__yyparse(void *scanner, struct cdecl **out); } @@ -132,7 +133,7 @@ static void free_decl(struct cdecl *x) } } -void cdecl_free(struct cdecl *decl) +void cdecl__free(struct cdecl *decl) { free_decl(decl); }