public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [asan] Change shadow type from unsigned to signed
@ 2012-10-19  4:53 Xinliang David Li
  2012-10-19  8:14 ` Jakub Jelinek
  0 siblings, 1 reply; 2+ messages in thread
From: Xinliang David Li @ 2012-10-19  4:53 UTC (permalink / raw)
  To: GCC Patches; +Cc: Jakub Jelinek, Diego Novillo, Dodji Seketeli, Wei Mi

The following is small bug fix caught during testing. The shadow value
for redzone can be negative, so the shadow type must be signed for the
check to succeed.

Ok for the branch?

thanks,

David


Index: asan.c
===================================================================
--- asan.c      (revision 192567)
+++ asan.c      (working copy)
@@ -825,10 +825,10 @@ static void
 asan_init_shadow_ptr_types (void)
 {
   asan_shadow_set = new_alias_set ();
-  shadow_ptr_types[0] = build_distinct_type_copy (unsigned_char_type_node);
+  shadow_ptr_types[0] = build_distinct_type_copy (signed_char_type_node);
   TYPE_ALIAS_SET (shadow_ptr_types[0]) = asan_shadow_set;
   shadow_ptr_types[0] = build_pointer_type (shadow_ptr_types[0]);
-  shadow_ptr_types[1] = build_distinct_type_copy (short_unsigned_type_node);
+  shadow_ptr_types[1] = build_distinct_type_copy (short_integer_type_node);
   TYPE_ALIAS_SET (shadow_ptr_types[1]) = asan_shadow_set;
   shadow_ptr_types[1] = build_pointer_type (shadow_ptr_types[1]);
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [asan] Change shadow type from unsigned to signed
  2012-10-19  4:53 [asan] Change shadow type from unsigned to signed Xinliang David Li
@ 2012-10-19  8:14 ` Jakub Jelinek
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Jelinek @ 2012-10-19  8:14 UTC (permalink / raw)
  To: Xinliang David Li; +Cc: GCC Patches, Diego Novillo, Dodji Seketeli, Wei Mi

On Thu, Oct 18, 2012 at 08:40:32PM -0700, Xinliang David Li wrote:
> The following is small bug fix caught during testing. The shadow value
> for redzone can be negative, so the shadow type must be signed for the
> check to succeed.
> 
> Ok for the branch?

Yes (with a proper ChangeLog.asan entry ;)

> --- asan.c      (revision 192567)
> +++ asan.c      (working copy)
> @@ -825,10 +825,10 @@ static void
>  asan_init_shadow_ptr_types (void)
>  {
>    asan_shadow_set = new_alias_set ();
> -  shadow_ptr_types[0] = build_distinct_type_copy (unsigned_char_type_node);
> +  shadow_ptr_types[0] = build_distinct_type_copy (signed_char_type_node);
>    TYPE_ALIAS_SET (shadow_ptr_types[0]) = asan_shadow_set;
>    shadow_ptr_types[0] = build_pointer_type (shadow_ptr_types[0]);
> -  shadow_ptr_types[1] = build_distinct_type_copy (short_unsigned_type_node);
> +  shadow_ptr_types[1] = build_distinct_type_copy (short_integer_type_node);
>    TYPE_ALIAS_SET (shadow_ptr_types[1]) = asan_shadow_set;
>    shadow_ptr_types[1] = build_pointer_type (shadow_ptr_types[1]);
>  }

	Jakub

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-19  7:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-19  4:53 [asan] Change shadow type from unsigned to signed Xinliang David Li
2012-10-19  8:14 ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).