diff options
-rw-r--r-- | devel/cqual/Makefile | 9 | ||||
-rw-r--r-- | devel/cqual/distinfo | 17 | ||||
-rw-r--r-- | devel/cqual/patches/patch-ac | 8 | ||||
-rw-r--r-- | devel/cqual/patches/patch-ba | 15 | ||||
-rw-r--r-- | devel/cqual/patches/patch-bb | 66 | ||||
-rw-r--r-- | devel/cqual/patches/patch-bc | 39 | ||||
-rw-r--r-- | devel/cqual/patches/patch-bd | 36 | ||||
-rw-r--r-- | devel/cqual/patches/patch-be | 45 | ||||
-rw-r--r-- | devel/cqual/patches/patch-bf | 14 | ||||
-rw-r--r-- | devel/cqual/patches/patch-bg | 18 | ||||
-rw-r--r-- | devel/cqual/patches/patch-bh | 30 | ||||
-rw-r--r-- | devel/cqual/patches/patch-bi | 32 | ||||
-rw-r--r-- | devel/cqual/patches/patch-bj | 15 | ||||
-rw-r--r-- | devel/cqual/patches/patch-bk | 37 | ||||
-rw-r--r-- | devel/cqual/patches/patch-bl | 30 | ||||
-rw-r--r-- | devel/cqual/patches/patch-bm | 41 |
16 files changed, 445 insertions, 7 deletions
diff --git a/devel/cqual/Makefile b/devel/cqual/Makefile index a0d56b9c5d2..37f96986957 100644 --- a/devel/cqual/Makefile +++ b/devel/cqual/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.5 2006/01/15 21:55:14 rillig Exp $ +# $NetBSD: Makefile,v 1.6 2006/01/18 23:24:12 rillig Exp $ # DISTNAME= cqual-0.991 @@ -18,6 +18,13 @@ REPLACE_PERL+= bin/* INSTALLATION_DIRS= share/doc/cqual share/examples/cqual +.include "../../mk/bsd.prefs.mk" + +.if ${OPSYS} == "SunOS" && ${OS_VERSION} == "5.8" +pre-build: + ${ECHO} "/* empty dummy header */" > ${BUILDLINK_DIR:Q}/include/stdint.h +.endif + post-install: ${INSTALL_DATA} ${WRKSRC:Q}/doc/user-guide.pdf ${PREFIX:Q}/share/doc/cqual/ ${INSTALL_DATA} ${WRKSRC:Q}/examples/* ${PREFIX:Q}/share/examples/cqual/ diff --git a/devel/cqual/distinfo b/devel/cqual/distinfo index 23d870ab456..24fb4716b5e 100644 --- a/devel/cqual/distinfo +++ b/devel/cqual/distinfo @@ -1,8 +1,21 @@ -$NetBSD: distinfo,v 1.2 2006/01/13 07:51:42 rillig Exp $ +$NetBSD: distinfo,v 1.3 2006/01/18 23:24:12 rillig Exp $ SHA1 (cqual-0.991.tar.gz) = f559af6947465ca242f19c1f499c7cb004e713e4 RMD160 (cqual-0.991.tar.gz) = e3837a11c75f750196ec4be7f991ec519c1260f6 Size (cqual-0.991.tar.gz) = 1197696 bytes SHA1 (patch-aa) = bf21f9d9213beb54847a79fdf1213c7378ac062d SHA1 (patch-ab) = 5ededa6979542cb83c53abd38fe9923495562a99 -SHA1 (patch-ac) = d8865d91707d76f2ce3acedf992cec6821c54344 +SHA1 (patch-ac) = 0aee16d388ff2d40ca176c0f313505d83ee3aa52 +SHA1 (patch-ba) = 316aae97a0031bbe229baaa0519ad25a2b901663 +SHA1 (patch-bb) = 517c9d0a151e6d501c3ea49b0d612e75a09fc1db +SHA1 (patch-bc) = 5b37902e672fe28156908a98df69e0630e9c9738 +SHA1 (patch-bd) = 1d434fac7ca549e2b0e0e12d191c5846e66bedf5 +SHA1 (patch-be) = 0a1a9bd41f57805da84922538fe2c42d84fd33f0 +SHA1 (patch-bf) = 2192b53278568ca783687d025ecca85569185f42 +SHA1 (patch-bg) = 4b53d4caac2c24a98e8acbc054877256c6ddebac +SHA1 (patch-bh) = b4e05070ced650b4dea42620e2ebb78eabf743ee +SHA1 (patch-bi) = d6786e93d2f77c56f2de3cdb8d29cb34dc43916b +SHA1 (patch-bj) = 66c4c93fe18841db68ccdc2bb8e4d22a06abd731 +SHA1 (patch-bk) = 58edca8937cd587911d58bebc5d6bbbea87ca028 +SHA1 (patch-bl) = 70fe692644529a38bdaefbff67a264db9179e5f7 +SHA1 (patch-bm) = eb57badc6c4530243aeeeb14aba4418d77ea453c diff --git a/devel/cqual/patches/patch-ac b/devel/cqual/patches/patch-ac index cc5a410a47d..848ab400ea2 100644 --- a/devel/cqual/patches/patch-ac +++ b/devel/cqual/patches/patch-ac @@ -1,4 +1,4 @@ -$NetBSD: patch-ac,v 1.1 2006/01/13 07:51:42 rillig Exp $ +$NetBSD: patch-ac,v 1.2 2006/01/18 23:24:12 rillig Exp $ From the maintainers via private mail. It fixes the special handling of malloc(), which had been confusing to me. Fixed in CVS. @@ -8,9 +8,9 @@ Index: src/analyze.c RCS file: /cvsroot/cqual/cqual/src/analyze.c,v retrieving revision 1.373 diff -u -r1.373 analyze.c ---- src/analyze.c 12 Sep 2005 14:55:48 -0000 1.373 -+++ src/analyze.c 13 Jan 2006 05:36:38 -0000 -@@ -2342,13 +2342,16 @@ +--- src/analyze.c.orig 2003-12-12 16:06:30.000000000 +0100 ++++ src/analyze.c 2006-01-16 14:57:37.428011800 +0100 +@@ -2273,13 +2273,16 @@ static einfo analyze_expression(expressi fqt = points_to_qtype(f_info.qt); args = arg_qtypes(fqt); diff --git a/devel/cqual/patches/patch-ba b/devel/cqual/patches/patch-ba new file mode 100644 index 00000000000..d66db3f5d02 --- /dev/null +++ b/devel/cqual/patches/patch-ba @@ -0,0 +1,15 @@ +$NetBSD: patch-ba,v 1.1 2006/01/18 23:24:12 rillig Exp $ + +SunPro says: void functions cannot return a value. + +--- src/array.h.orig 2001-08-16 00:46:35.000000000 +0200 ++++ src/array.h 2006-01-16 14:13:15.764481600 +0100 +@@ -50,7 +50,7 @@ type *name ## _extend(name a, int by) \ + } \ + void name ## _reset(name a) \ + { \ +- return array_reset((struct array *)a); \ ++ array_reset((struct array *)a); \ + } \ + size_t name ## _length(name a) \ + { \ diff --git a/devel/cqual/patches/patch-bb b/devel/cqual/patches/patch-bb new file mode 100644 index 00000000000..f9790523197 --- /dev/null +++ b/devel/cqual/patches/patch-bb @@ -0,0 +1,66 @@ +$NetBSD: patch-bb,v 1.1 2006/01/18 23:24:12 rillig Exp $ + +SunPro says: void functions cannot return a value. + +--- src/common-analyze.c.orig 2003-09-27 23:35:48.000000000 +0200 ++++ src/common-analyze.c 2006-01-16 14:41:27.006921000 +0100 +@@ -36,11 +36,11 @@ effect global_effect = NULL; /* Effect c + of every function */ + effect global_env = NULL; /* Locations bound in global scope */ + +-inline void mk_effect_leq_global_env(effect e) ++void mk_effect_leq_global_env(effect e) + { + mkleq_effect(e, global_env); + } +-inline void mk_effect_leq_global_effect(effect e) ++void mk_effect_leq_global_effect(effect e) + { + mkleq_effect(e, global_effect); + } +@@ -492,21 +492,30 @@ void mkNonConst_aggregate(location loc, + * * + **************************************************************************/ + +-inline einfo mkeinfo(qtype qt, effect eff, bool ismalloc) ++einfo mkeinfo(qtype qt, effect eff, bool ismalloc) + { +- struct einfo result = {qt: qt, eff: eff, ismalloc: ismalloc}; ++ struct einfo result; ++ ++ result.qt = qt; ++ result.eff = eff; ++ result.ismalloc = ismalloc; + return result; + } + +-inline sinfo mksinfo(effect eff) ++sinfo mksinfo(effect eff) + { +- struct sinfo result = {eff: eff}; ++ struct sinfo result; ++ ++ result.eff = eff; + return result; + } + +-inline dinfo mkdinfo(effect eff, effect alocs) ++dinfo mkdinfo(effect eff, effect alocs) + { +- struct dinfo result = {eff: eff, alocs: alocs}; ++ struct dinfo result; ++ ++ result.eff = eff; ++ result.alocs = alocs; + return result; + } + +@@ -550,7 +559,7 @@ struct operator operators[] = + {0, 0, NULL}}; + + /* Given an operator function name, return its signature */ +-inline operator find_op_name(const char *name) ++operator find_op_name(const char *name) + { + int i; + diff --git a/devel/cqual/patches/patch-bc b/devel/cqual/patches/patch-bc new file mode 100644 index 00000000000..50859c5e9b2 --- /dev/null +++ b/devel/cqual/patches/patch-bc @@ -0,0 +1,39 @@ +$NetBSD: patch-bc,v 1.1 2006/01/18 23:24:12 rillig Exp $ + +SunPro cannot handle extern inline functions. + +--- src/common-analyze.h.orig 2003-09-10 20:52:03.000000000 +0200 ++++ src/common-analyze.h 2006-01-16 14:40:59.088069200 +0100 +@@ -73,7 +73,7 @@ extern struct operator operators[]; + + #define exists_op_kind(k) (find_op_kind(k) != NULL) + +-inline operator find_op_name(const char *name); ++operator find_op_name(const char *name); + void reset_operators(void); + bool match_signature(enum sig_kind k, qtype qt, location loc); + bool add_op_signature(operator op, qtype qt, location loc); +@@ -95,8 +95,8 @@ qtype do_dereference(location loc, qtype + einfo put_id_in_context(location, einfo, context); + void init_string(location, qtype lhs_qtype, qtype rhs_qtype, const char *error_message); + +-inline void mk_effect_leq_global_env(effect e); +-inline void mk_effect_leq_global_effect(effect e); ++void mk_effect_leq_global_env(effect e); ++void mk_effect_leq_global_effect(effect e); + + extern void qtype_mklhs_nonconst(location, qtype); + extern void mkNonConst_qual(location, qual, const char *error_message); +@@ -104,9 +104,9 @@ extern void mkNonConst_pointer(location, + extern void mkNonConst_aggregate(location, qtype, const char *error_message); + extern void mkConst_pointer(location, qtype, const char *error_message); + +-inline einfo mkeinfo(qtype qt, effect eff, bool ismalloc); +-inline sinfo mksinfo(effect eff); +-inline dinfo mkdinfo(effect eff, effect alocs); ++einfo mkeinfo(qtype qt, effect eff, bool ismalloc); ++sinfo mksinfo(effect eff); ++dinfo mkdinfo(effect eff, effect alocs); + + bool file_pointer_qtype(qtype qt); + diff --git a/devel/cqual/patches/patch-bd b/devel/cqual/patches/patch-bd new file mode 100644 index 00000000000..9b0c22346a4 --- /dev/null +++ b/devel/cqual/patches/patch-bd @@ -0,0 +1,36 @@ +$NetBSD: patch-bd,v 1.1 2006/01/18 23:24:12 rillig Exp $ + +SunPro says: void functions cannot return a value. + +--- src/confine_inf.c.orig 2002-12-30 22:43:53.000000000 +0100 ++++ src/confine_inf.c 2006-01-16 14:35:36.739367700 +0100 +@@ -183,7 +183,8 @@ static void confine_inf_declaration(decl + case kind_extension_decl: + { + extension_decl ed = CAST(extension_decl, d); +- return confine_inf_declaration(ed->decl, cs); ++ confine_inf_declaration(ed->decl, cs); ++ return; + /* Ignore __extension__ */ + }; + default: +@@ -642,14 +643,16 @@ static void confine_inf_unary_expression + { + assert(context == rpos); + if (type_function(e->arg1->type)) +- return confine_inf_expression(e->arg1, context); ++ confine_inf_expression(e->arg1, context); + else +- return confine_inf_expression(e->arg1, apos); ++ confine_inf_expression(e->arg1, apos); ++ return; + } + break; + case kind_extension_expr: + { +- return confine_inf_expression(e->arg1, context); ++ confine_inf_expression(e->arg1, context); ++ return; + } + break; + case kind_sizeof_expr: diff --git a/devel/cqual/patches/patch-be b/devel/cqual/patches/patch-be new file mode 100644 index 00000000000..e943d97368e --- /dev/null +++ b/devel/cqual/patches/patch-be @@ -0,0 +1,45 @@ +$NetBSD: patch-be,v 1.1 2006/01/18 23:24:12 rillig Exp $ + +SunPro cannot handle this style of direct initialization. + +--- src/flow.c.orig 2003-09-10 20:52:05.000000000 +0200 ++++ src/flow.c 2006-01-16 14:37:58.365503000 +0100 +@@ -218,11 +218,13 @@ void finish_flow_sensitive(void) + static inline einfo mkeinfo(qtype qt, store out, store true_out, + store false_out, bool ismalloc) + { +- struct einfo result = {qt: qt, +- out: out, +- true_out: true_out, +- false_out: false_out, +- ismalloc: ismalloc}; ++ struct einfo result; ++ ++ result.qt = qt; ++ result.out = out; ++ result.true_out = true_out; ++ result.false_out = false_out; ++ result.ismalloc = ismalloc; + return result; + } + +@@ -250,13 +252,17 @@ static inline store false_out_einfo(einf + + static inline sinfo mksinfo(store out) + { +- struct sinfo result = {out: out}; ++ struct sinfo result; ++ ++ result.out = out; + return result; + } + + static inline dinfo mkdinfo(store out) + { +- struct dinfo result = {out: out}; ++ struct dinfo result; ++ ++ result.out = out; + return result; + } + diff --git a/devel/cqual/patches/patch-bf b/devel/cqual/patches/patch-bf new file mode 100644 index 00000000000..154439464e6 --- /dev/null +++ b/devel/cqual/patches/patch-bf @@ -0,0 +1,14 @@ +$NetBSD: patch-bf,v 1.1 2006/01/18 23:24:12 rillig Exp $ + +Solaris does not have <stdint.h>, and the code does not seem to need it. + +--- src/libcompat/regions.c.orig 2003-09-11 20:53:38.000000000 +0200 ++++ src/libcompat/regions.c 2006-01-16 15:00:23.211191300 +0100 +@@ -42,7 +42,6 @@ + #include <assert.h> + #include <stdio.h> + #include <string.h> +-#include <stdint.h> + + #define RPAGESIZE (1 << RPAGELOG) + #define K 2 diff --git a/devel/cqual/patches/patch-bg b/devel/cqual/patches/patch-bg new file mode 100644 index 00000000000..0ce7741aa2d --- /dev/null +++ b/devel/cqual/patches/patch-bg @@ -0,0 +1,18 @@ +$NetBSD: patch-bg,v 1.1 2006/01/18 23:24:12 rillig Exp $ + +The two structures are not meant to be empty, but its contents is +unspecified. + +--- src/iquals.y.orig 2003-09-10 20:52:05.000000000 +0200 ++++ src/iquals.y 2006-01-16 14:47:48.191242700 +0100 +@@ -102,8 +102,8 @@ void fatal(const char *format, ...) + } + + /* HACK: We should really put a better interface in quals.c */ +-struct Store {}; +-struct Aloc {}; ++struct Store; ++struct Aloc; + void propagate_store_cell_forward(store s, aloc al) {} + void propagate_store_cell_backward(store s, aloc al) {} + void report_qerror(location loc, severity sev, const char *format, ...) {} diff --git a/devel/cqual/patches/patch-bh b/devel/cqual/patches/patch-bh new file mode 100644 index 00000000000..273a3168de4 --- /dev/null +++ b/devel/cqual/patches/patch-bh @@ -0,0 +1,30 @@ +$NetBSD: patch-bh,v 1.1 2006/01/18 23:24:12 rillig Exp $ + +SunPro thinks that the result of the "," operator is not an lvalue. +Fixed this by using *&foo instead of foo. + +--- src/libcompat/pages.c.orig 2003-09-11 21:03:24.000000000 +0200 ++++ src/libcompat/pages.c 2006-01-16 14:11:33.668681000 +0100 +@@ -299,7 +299,7 @@ static void preaccess_regionmap (pageid + } + } + +-#define page_region(pagenb) (preaccess_regionmap(pagenb), __rcregionmap[(pagenb)/RPAGETABLESIZE2][(pagenb)%RPAGETABLESIZE2]) ++#define page_region(pagenb) (*(preaccess_regionmap(pagenb), &(__rcregionmap[(pagenb)/RPAGETABLESIZE2][(pagenb)%RPAGETABLESIZE2]))) + + #else + +@@ -322,10 +322,10 @@ static void preaccess_regionmap (pageid + } + } + +-#define page_region(pagenb) (preaccess_regionmap(pagenb), \ +- __rcregionmap[(pagenb)/(RPAGETABLESIZE2*RPAGETABLESIZE3)] \ ++#define page_region(pagenb) (*(preaccess_regionmap(pagenb), \ ++ &(__rcregionmap[(pagenb)/(RPAGETABLESIZE2*RPAGETABLESIZE3)] \ + [((pagenb)%(RPAGETABLESIZE2*RPAGETABLESIZE3))/RPAGETABLESIZE3] \ +- [(pagenb)%RPAGETABLESIZE3]) ++ [(pagenb)%RPAGETABLESIZE3]))) + + #endif /* SIZEOF_VOIDP <= 4 */ + diff --git a/devel/cqual/patches/patch-bi b/devel/cqual/patches/patch-bi new file mode 100644 index 00000000000..91b58bbc8cb --- /dev/null +++ b/devel/cqual/patches/patch-bi @@ -0,0 +1,32 @@ +$NetBSD: patch-bi,v 1.1 2006/01/18 23:24:12 rillig Exp $ + +SunPro says: void functions cannot return a value. + +--- src/poly-quals.c.orig 2003-12-10 19:31:03.000000000 +0100 ++++ src/poly-quals.c 2006-01-16 14:45:40.906477400 +0100 +@@ -2833,13 +2833,13 @@ static void _traverse_error_path_edges(q + void traverse_error_path_edges(qual q, bool expand_summaries, bool nonerrors, + edge_traverse_fn f, void *arg) + { +- return _traverse_error_path_edges (q, FALSE, expand_summaries, nonerrors, f, arg); ++ _traverse_error_path_edges (q, FALSE, expand_summaries, nonerrors, f, arg); + } + + void cs_traverse_error_path_edges(qual q, bool expand_summaries, bool nonerrors, + edge_traverse_fn f, void *arg) + { +- return _traverse_error_path_edges (q, TRUE, expand_summaries, nonerrors, f, arg); ++ _traverse_error_path_edges (q, TRUE, expand_summaries, nonerrors, f, arg); + } + + /************************************************************************** +@@ -3016,7 +3016,8 @@ static void _dn_dfs (FILE* f, region scr + if (root->link) + { + add_graph_edge (f, root, ecr_qual (root), "+", TRUE); +- return _dn_dfs (f, scratch, ecr_qual (root), depth, printed_edges); ++ _dn_dfs (f, scratch, ecr_qual (root), depth, printed_edges); ++ return; + } + + scan_qual_edge_hashset (e, qess, root->u.var.lb) diff --git a/devel/cqual/patches/patch-bj b/devel/cqual/patches/patch-bj new file mode 100644 index 00000000000..edcaa0b828b --- /dev/null +++ b/devel/cqual/patches/patch-bj @@ -0,0 +1,15 @@ +$NetBSD: patch-bj,v 1.1 2006/01/18 23:24:12 rillig Exp $ + +SunPro says: void functions cannot return a value. + +--- src/quals.c.orig 2003-09-25 00:36:49.000000000 +0200 ++++ src/quals.c 2006-01-16 14:38:37.833882000 +0100 +@@ -2714,7 +2714,7 @@ void traverse_error_path_edges(qual q,bo + void cs_traverse_error_path_edges(qual q,bool expand_summaries, bool nonerrors, + edge_traverse_fn f,void* arg) + { +- return traverse_error_path_edges (q, expand_summaries, nonerrors, f, arg); ++ traverse_error_path_edges (q, expand_summaries, nonerrors, f, arg); + } + + /* Call f(q', arg) for every node q' on all paths from qualifier q to diff --git a/devel/cqual/patches/patch-bk b/devel/cqual/patches/patch-bk new file mode 100644 index 00000000000..6b9dc0ee2dc --- /dev/null +++ b/devel/cqual/patches/patch-bk @@ -0,0 +1,37 @@ +$NetBSD: patch-bk,v 1.1 2006/01/18 23:24:12 rillig Exp $ + +SunPro cannot handle direct initialization of structures. + +--- src/rinf_analyze.c.orig 2003-09-06 02:50:16.000000000 +0200 ++++ src/rinf_analyze.c 2006-01-16 14:49:27.617152900 +0100 +@@ -107,19 +107,27 @@ static bool is_memcpy_fun(const char *na + + static inline einfo mkeinfo(alocreftype tau, effecttype eff) + { +- struct einfo result = {tau: tau, eff: eff}; ++ struct einfo result; ++ ++ result.tau = tau; ++ result.eff = eff; + return result; + } + + static inline sinfo mksinfo(effecttype eff) + { +- struct sinfo result = {eff: eff}; ++ struct sinfo result; ++ ++ result.eff = eff; + return result; + } + + static inline dinfo mkdinfo(effecttype eff, effecttype alocs) + { +- struct dinfo result = {eff: eff, alocs: alocs}; ++ struct dinfo result; ++ ++ result.eff = eff; ++ result.alocs = alocs; + return result; + } + diff --git a/devel/cqual/patches/patch-bl b/devel/cqual/patches/patch-bl new file mode 100644 index 00000000000..5010cad0629 --- /dev/null +++ b/devel/cqual/patches/patch-bl @@ -0,0 +1,30 @@ +$NetBSD: patch-bl,v 1.1 2006/01/18 23:24:12 rillig Exp $ + +SunPro does not know __alignof__. Replaced it with the size of ''x'', +rounded up to the next power of two. + +--- src/types.c.orig 2003-12-12 17:09:49.000000000 +0100 ++++ src/types.c 2006-01-16 14:27:49.278596800 +0100 +@@ -23,6 +23,22 @@ Boston, MA 02111-1307, USA. */ + #include <stddef.h> + #include "user-qual.h" + ++#if !defined(__GNUC__) ++ ++/* http://www.hackersdelight.org/HDcode.htm, figure 3.3 */ ++static inline size_t clp2(size_t x) { ++ x = x - 1; ++ x = x | (x >> 1); ++ x = x | (x >> 2); ++ x = x | (x >> 4); ++ x = x | (x >> 8); ++ x = x | (x >>16); ++ return x + 1; ++} ++ ++# define __alignof__(x) (clp2(sizeof(x))) ++#endif ++ + struct type + { + enum { tk_primitive, tk_complex, tk_tagged, tk_error, tk_void, diff --git a/devel/cqual/patches/patch-bm b/devel/cqual/patches/patch-bm new file mode 100644 index 00000000000..5130f3ed512 --- /dev/null +++ b/devel/cqual/patches/patch-bm @@ -0,0 +1,41 @@ +$NetBSD: patch-bm,v 1.1 2006/01/18 23:24:12 rillig Exp $ + +Don't use alloca. (Solaris would require <alloca.h> to be included for +it.) + +--- src/utils.c.orig 2003-09-10 20:52:09.000000000 +0200 ++++ src/utils.c 2006-01-16 14:44:06.890343700 +0100 +@@ -19,6 +19,7 @@ Boston, MA 02111-1307, USA. */ + #include <ctype.h> + #include <signal.h> + #include <stdio.h> ++#include <stdlib.h> + #include <stdarg.h> + #include <string.h> + #include <unistd.h> +@@ -328,16 +329,23 @@ const char *name_with_loc(region r, cons + char *index; + int base_len; + char *base_name; ++ char *result; + + if ((index = strstr(name, "@"))) + base_len = index - name; + else + base_len = strlen(name); +- base_name = alloca((base_len + 2) * sizeof(char)); ++ base_name = malloc((base_len + 2) * sizeof(char)); ++ if (base_name == NULL) { ++ perror("cqual: in name_with_loc"); ++ exit(EXIT_FAILURE); ++ } + strncpy(base_name, name, base_len); + base_name[base_len] = '@'; + base_name[base_len+1] = '\0'; +- return rstrcat(r, base_name, inttostr(r, loc->lineno)); ++ result = rstrcat(r, base_name, inttostr(r, loc->lineno)); ++ free(base_name); ++ return result; + } + + /* A function to let you pass a function pointer which prints to |