Commit c132770e by Martin Liska Committed by Martin Liska

re PR pch/68758 (Invalid read of size 8 in gt_pch_save (ggc-common.c:551))

Fix PR pch/68758.

	PR pch/68758
	* ggc-common.c (gt_pch_save): Use ENABLE_VALGRIND_ANNOTATIONS macro
	instead of ENABLE_VALGRIND_CHECKING.

From-SVN: r232915
parent 9a175e65
2016-01-28 Martin Liska <mliska@suse.cz>
PR pch/68758
* ggc-common.c (gt_pch_save): Use ENABLE_VALGRIND_ANNOTATIONS macro
instead of ENABLE_VALGRIND_CHECKING.
2016-01-27 Richard Henderson <rth@redhat.com> 2016-01-27 Richard Henderson <rth@redhat.com>
PR rtl-opt/69447 PR rtl-opt/69447
......
...@@ -492,7 +492,7 @@ gt_pch_save (FILE *f) ...@@ -492,7 +492,7 @@ gt_pch_save (FILE *f)
ggc_pch_prepare_write (state.d, state.f); ggc_pch_prepare_write (state.d, state.f);
#if defined ENABLE_VALGRIND_CHECKING && defined VALGRIND_GET_VBITS #if defined ENABLE_VALGRIND_ANNOTATIONS && defined VALGRIND_GET_VBITS
vec<char> vbits = vNULL; vec<char> vbits = vNULL;
#endif #endif
...@@ -504,7 +504,7 @@ gt_pch_save (FILE *f) ...@@ -504,7 +504,7 @@ gt_pch_save (FILE *f)
this_object_size = state.ptrs[i]->size; this_object_size = state.ptrs[i]->size;
this_object = XRESIZEVAR (char, this_object, this_object_size); this_object = XRESIZEVAR (char, this_object, this_object_size);
} }
#if defined ENABLE_VALGRIND_CHECKING && defined VALGRIND_GET_VBITS #if defined ENABLE_VALGRIND_ANNOTATIONS && defined VALGRIND_GET_VBITS
/* obj might contain uninitialized bytes, e.g. in the trailing /* obj might contain uninitialized bytes, e.g. in the trailing
padding of the object. Avoid warnings by making the memory padding of the object. Avoid warnings by making the memory
temporarily defined and then restoring previous state. */ temporarily defined and then restoring previous state. */
...@@ -561,7 +561,7 @@ gt_pch_save (FILE *f) ...@@ -561,7 +561,7 @@ gt_pch_save (FILE *f)
state.ptrs[i]->note_ptr_fn == gt_pch_p_S); state.ptrs[i]->note_ptr_fn == gt_pch_p_S);
if (state.ptrs[i]->note_ptr_fn != gt_pch_p_S) if (state.ptrs[i]->note_ptr_fn != gt_pch_p_S)
memcpy (state.ptrs[i]->obj, this_object, state.ptrs[i]->size); memcpy (state.ptrs[i]->obj, this_object, state.ptrs[i]->size);
#if defined ENABLE_VALGRIND_CHECKING && defined VALGRIND_GET_VBITS #if defined ENABLE_VALGRIND_ANNOTATIONS && defined VALGRIND_GET_VBITS
if (__builtin_expect (get_vbits == 1, 0)) if (__builtin_expect (get_vbits == 1, 0))
{ {
(void) VALGRIND_SET_VBITS (state.ptrs[i]->obj, vbits.address (), (void) VALGRIND_SET_VBITS (state.ptrs[i]->obj, vbits.address (),
...@@ -575,7 +575,7 @@ gt_pch_save (FILE *f) ...@@ -575,7 +575,7 @@ gt_pch_save (FILE *f)
} }
#endif #endif
} }
#if defined ENABLE_VALGRIND_CHECKING && defined VALGRIND_GET_VBITS #if defined ENABLE_VALGRIND_ANNOTATIONS && defined VALGRIND_GET_VBITS
vbits.release (); vbits.release ();
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment