On Thu, 24 Mar 2011, Anders Magnusson wrote:
>
> Module Name: pcc
> Committed By: ragge
> Date: Thu Mar 24 19:47:14 UTC 2011
>
> Modified Files:
> pcc/cc/cc: cc.c
>
> Log Message:
> Initial support for --sysroot, from Joerg Sonnenberger.
I get a coredump with this (not using --sysroot, but two -Bprefix flags),
patch below (realloc needs to increase the amount of space..)
regards,
iain
Index: cc.c
===================================================================
RCS file: /cvsroot/pcc/cc/cc/cc.c,v
retrieving revision 1.175
diff -u -r1.175 cc.c
--- cc.c 24 Mar 2011 19:47:14 -0000 1.175
+++ cc.c 24 Mar 2011 21:26:10 -0000
@@ -1253,7 +1253,7 @@
add_prefix(const char *prefix)
{
file_prefixes = realloc(file_prefixes,
- sizeof(*file_prefixes) * file_prefixes_cnt);
+ sizeof(*file_prefixes) * (file_prefixes_cnt + 1));
if (file_prefixes == NULL) {
error("malloc failed");
exit(1);