[Prev][Next][Index]
Bug in SgStatement::insertStmtBefore()
- Date: Thu, 20 Jun 1996 14:12:33 -0600 (MDT)
- From: Diego Novillo <diego@cs.ualberta.ca>
- To: Sage Bug Reports <sage-bugs@rainier.extreme.indiana.edu>
- Subject: Bug in SgStatement::insertStmtBefore()
- Sender: owner-sage-bugs@extreme.indiana.edu
I seem to have found a bug in SgStatement::insertStmtBefore(). This is the
code that I'm executing. The function createLockStmt() simply creates the
statement "Lock();". The variable 'stmt' is the place where I want to
insert the call to lock:
SgStatement *synch = this->createLockStmt();
stmt->insertStmtBefore(*synch);
This is the code I am applying the above construct to:
---------------------------------------------------------------------------
struct Record {
...
};
main()
{
struct Record s;
for (...) { <-- 'stmt' points here.
}
}
---------------------------------------------------------------------------
In this case, the variable 'stmt' is the for loop. Therefore, the statement
'stmt->insertStmtBefore(*synch)' should yield:
---------------------------------------------------------------------------
struct Record {
...
};
main()
{
struct Record s;
Lock();
for (...) {
}
}
---------------------------------------------------------------------------
However, what I'm getting is this:
---------------------------------------------------------------------------
struct Record {
...
};
main()
{
struct Record { ===> This doesn't make sense!
Lock();
} s;
for (...) {
}
}
---------------------------------------------------------------------------
Thank you. Diego.
--
Diego Novillo (diego@cs.ualberta.ca) | Dept of Computing Science
WWW http://web.cs.ualberta.ca/~diego | University of Alberta
Use 'finger' to get my PGP public key | Edmonton, Alberta - Canada