|
From: <sv...@va...> - 2006-10-18 12:41:59
|
Author: sewardj
Date: 2006-10-18 13:41:55 +0100 (Wed, 18 Oct 2006)
New Revision: 6319
Log:
Observe the rule that requires all instrumenters to copy verbatim any
IR preamble preceding the first IMark.
Modified:
trunk/memcheck/mc_translate.c
Modified: trunk/memcheck/mc_translate.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
--- trunk/memcheck/mc_translate.c 2006-10-18 06:25:34 UTC (rev 6318)
+++ trunk/memcheck/mc_translate.c 2006-10-18 12:41:55 UTC (rev 6319)
@@ -3300,11 +3300,29 @@
=20
mce.bogusLiterals =3D bogus;
=20
- /* Iterate over the stmts to generate instrumentation. */
+ /* Copy verbatim any IR preamble preceding the first IMark */
=20
- for (i =3D 0; i < bb_in->stmts_used; i++) {
+ i =3D 0;
+ while (i < bb_in->stmts_used && bb_in->stmts[i]->tag !=3D Ist_IMark) =
{
=20
st =3D bb_in->stmts[i];
+ tl_assert(st);
+ tl_assert(isFlatIRStmt(st));
+
+ addStmtToIRBB( bb, bb_in->stmts[i] );
+ i++;
+ }
+
+ /* Iterate over the remaining stmts to generate instrumentation. */
+
+ tl_assert(bb_in->stmts_used > 0);
+ tl_assert(i >=3D 0);
+ tl_assert(i < bb_in->stmts_used);
+ tl_assert(bb_in->stmts[i]->tag =3D=3D Ist_IMark);
+
+ for (/* use current i*/; i < bb_in->stmts_used; i++) {
+
+ st =3D bb_in->stmts[i];
first_stmt =3D bb->stmts_used;
=20
if (verboze) {
|