Re: [Ada] fix potential memory corruption in annotated value cache

2011-09-19 Thread Alexandre Oliva
On Sep 16, 2011, Eric Botcazou wrote: > Yes, modulo Jakub's remark and s/NULL/NULL_TREE for zeroing in.base.from. Thanks, here's what I've just checked in. for gcc/ada/ChangeLog from Alexandre Oliva * gcc-interface/decl.c (annotate_value): Look up expression for insertion in the cache at

Re: [Ada] fix potential memory corruption in annotated value cache

2011-09-16 Thread Eric Botcazou
> Some possible fixes I considered were: > > 1. inserting on entry (as is), allocating the cache entry right away, > and *always* filling it before returning > > 2. inserting on entry (as is), allocating the cache entry right away, > and releasing it before returning unless we're filling it in > >

Re: [Ada] fix potential memory corruption in annotated value cache

2011-09-16 Thread Jakub Jelinek
On Fri, Sep 16, 2011 at 04:02:32AM -0300, Alexandre Oliva wrote: > - struct tree_int_map in; > + struct tree_int_map **h; > + >if (!annotate_value_cache) > annotate_value_cache = htab_create_ggc (512, tree_int_map_hash, > tree

[Ada] fix potential memory corruption in annotated value cache

2011-09-16 Thread Alexandre Oliva
A -fcompare-debug regression in s-regexp.adb on x86_64-linux-gnu turned out to be caused by a hashtable management error in annotate_value(). We ask for an insertion and leave the allocated slot empty while proceeding to other computations that might (a) return without filling it in, or (b) recurse