[patch] Robustify get_ref_base_and_extent and friend

View: New views
2 Messages — Rating Filter:   Alert me  

[patch] Robustify get_ref_base_and_extent and friend

by Eric Botcazou-3 :: Rate this Message:

| View Threaded | Show Only this Message

Hi,

we're having issues with get_ref_base_and_extent overflowing the offset and
thus returning bogus big negative values on 32-bit hosts.  The attached patch
converts it to double ints like get_inner_reference.  It also contains a small
fix for build_user_friendly_ref_for_offset that can stop if a field has again
too big an offset.

Tested on x86_64-suse-linux and i586-suse-linux, OK for mainline?


2012-05-30  Eric Botcazou  <ebotcazou@...>

        * tree-dfa.c (get_ref_base_and_extent): Compute the offset using
        double ints throughout.
        * tree-sra.c (build_user_friendly_ref_for_offset) <RECORD_TYPE>:
        Check that the position of the field is representable as an integer.


--
Eric Botcazou

[attachment removed]

Re: [patch] Robustify get_ref_base_and_extent and friend

by Richard Guenther-2 :: Rate this Message:

| View Threaded | Show Only this Message

On Wed, May 30, 2012 at 7:14 PM, Eric Botcazou <ebotcazou@...> wrote:
> Hi,
>
> we're having issues with get_ref_base_and_extent overflowing the offset and
> thus returning bogus big negative values on 32-bit hosts.  The attached patch
> converts it to double ints like get_inner_reference.  It also contains a small
> fix for build_user_friendly_ref_for_offset that can stop if a field has again
> too big an offset.
>
> Tested on x86_64-suse-linux and i586-suse-linux, OK for mainline?

Heh, I think I have a similar patch for the get_ref_base_and_extent issue
in my dev tree for almost three years ...

Ok!

Thanks,
Richard.

>
> 2012-05-30  Eric Botcazou  <ebotcazou@...>
>
>        * tree-dfa.c (get_ref_base_and_extent): Compute the offset using
>        double ints throughout.
>        * tree-sra.c (build_user_friendly_ref_for_offset) <RECORD_TYPE>:
>        Check that the position of the field is representable as an integer.
>
>
> --
> Eric Botcazou