This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch to generate correct dwarf2 debugging info


Nick

Nick Clifton wrote:
> 
> Hi Will,
> 
> : --- 7671,7675 ----
> :         {
> :           register unsigned length = GET_MODE_SIZE (mode) / sizeof (long);
> : !         long *array = xmalloc(sizeof(long) * 4);
> :           REAL_VALUE_TYPE rv;
> 
> As an alternative to xmalloc'ing why not just use a normal automatic
> declaration, ie:
> 
>              long array [4 * sizeof (long)];
> 
> Cheers
>         Nick

I think  you've missed the problem.  The address of the array is
stored in a AT struct so the life-time of array needs to match the
life-time of the AT.

Graham

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]