|
From: <sv...@va...> - 2005-12-19 23:24:42
|
Author: njn
Date: 2005-12-19 23:24:38 +0000 (Mon, 19 Dec 2005)
New Revision: 5390
Log:
With --undef-value-errors=3Dno, don't report any undefinedness errors, ev=
en
the ones that we can detect with the reduced instrumentation scheme. Thi=
s
is for clarity.
Modified:
branches/COMPVBITS/memcheck/mc_main.c
Modified: branches/COMPVBITS/memcheck/mc_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/COMPVBITS/memcheck/mc_main.c 2005-12-19 22:51:41 UTC (rev 53=
89)
+++ branches/COMPVBITS/memcheck/mc_main.c 2005-12-19 23:24:38 UTC (rev 53=
90)
@@ -1550,9 +1550,11 @@
vabits8 =3D get_vabits8(a);
if (VA_BITS8_READABLE !=3D vabits8) {
// Error! Nb: Report addressability errors in preference to
- // definedness errors.
+ // definedness errors. And don't report definedeness errors un=
less
+ // --undef-value-errors=3Dyes.
if (bad_addr !=3D NULL) *bad_addr =3D a;
- return ( VA_BITS8_NOACCESS =3D=3D vabits8 ? MC_AddrErr : MC_Val=
ueErr );
+ if ( VA_BITS8_NOACCESS =3D=3D vabits8 ) return MC_AddrErr;=
=20
+ else if ( MC_(clo_undef_value_errors) ) return MC_ValueErr;
}
a++;
}
@@ -1575,9 +1577,11 @@
vabits8 =3D get_vabits8(a);
if (VA_BITS8_READABLE !=3D vabits8) {
// Error! Nb: Report addressability errors in preference to
- // definedness errors.
+ // definedness errors. And don't report definedeness errors un=
less
+ // --undef-value-errors=3Dyes.
if (bad_addr !=3D NULL) *bad_addr =3D a;
- return ( VA_BITS8_NOACCESS =3D=3D vabits8 ? MC_AddrErr : MC_Val=
ueErr );
+ if ( VA_BITS8_NOACCESS =3D=3D vabits8 ) return MC_AddrErr;=
=20
+ else if ( MC_(clo_undef_value_errors) ) return MC_ValueErr;
}
/* Ok, a is safe to read. */
if (* ((UChar*)a) =3D=3D 0) {
@@ -2143,6 +2147,7 @@
{
MC_Error err_extra;
=20
+ tl_assert(MC_(clo_undef_value_errors));
tl_assert(VG_INVALID_THREADID !=3D tid);
if (isUnaddr) tl_assert(!isReg); // unaddressable register is impo=
ssible
mc_clear_MC_Error( &err_extra );
@@ -2222,6 +2227,7 @@
{
MC_Error err_extra;
=20
+ tl_assert(MC_(clo_undef_value_errors));
mc_clear_MC_Error( &err_extra );
err_extra.size =3D size;
err_extra.isUnaddr =3D False;
@@ -4080,7 +4086,8 @@
VG_(track_pre_mem_write) ( mc_check_is_writable );
VG_(track_post_mem_write) ( mc_post_mem_write );
=20
- VG_(track_pre_reg_read) ( mc_pre_reg_read );
+ if (MC_(clo_undef_value_errors))
+ VG_(track_pre_reg_read) ( mc_pre_reg_read );
=20
VG_(track_post_reg_write) ( mc_post_reg_write );
VG_(track_post_reg_write_clientcall_return)( mc_post_reg_write_client=
call );
|