Fixed a bug whereby a parethesized collection expression was not being rewritten correctly.

llvm-svn: 45776
This commit is contained in:
Fariborz Jahanian 2008-01-09 17:50:00 +00:00
parent 4de0c3978d
commit 22f2347791
2 changed files with 9 additions and 1 deletions

View File

@ -854,7 +854,7 @@ Stmt *RewriteTest::RewriteObjCForCollectionStmt(ObjCForCollectionStmt *S) {
// Replace ')' in for '(' type elem in collection ')' with ';'
SourceLocation endCollectionLoc = S->getCollection()->getLocEnd();
const char *endCollectionBuf = SM->getCharacterData(endCollectionLoc);
const char *lparenBuf = strchr(endCollectionBuf, ')');
const char *lparenBuf = strchr(endCollectionBuf+1, ')');
SourceLocation lparenLoc = startLoc.getFileLocWithOffset(lparenBuf-startBuf);
buf = ";\n\t";

View File

@ -24,6 +24,14 @@ int LOOP();
{ LOOP(); }
for (id el1 in self)
LOOP();
for (el in (self))
if (el)
LOOP();
for (el in ((self)))
if (el)
LOOP();
}
@end