LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 15500 - ARCMT uses an iterator after invalidation
Summary: ARCMT uses an iterator after invalidation
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: -New Bugs (show other bugs)
Version: trunk
Hardware: PC Windows NT
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-12 14:14 PDT by Aaron Ballman
Modified: 2013-04-01 16:13 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Ballman 2013-03-12 14:14:05 PDT
r171828 introduces a regression where ARCMT uses a std::list iterator after invalidation.  From the email thread:

"The use of iterators here is problematic because
handleProtectedScopeError can invalidate the iterators.  This is
causing a failed assertion in debug build of MSVC11 where there are
checked iterators involved.

From what I am seeing, handleProtectedScopeError has a Transaction
object, which on destruction winds up calling
CapturedDiagList::clearDiagnostic, and that calls erase on the list,
which invalidates the iterators.  Attempting to perform the comparison
then fires the assert.

I'm not entirely certain of the best way to solve this issue, but I
figured I would mention that it causes problems.  We have a test case
already demonstrating the issue with test\ARCMT\protected-scope.m"
Comment 1 Argyrios Kyrtzidis 2013-03-13 12:17:03 PDT
cloned to <rdar://problem/13411432>
Comment 2 Reid Kleckner 2013-03-26 13:01:45 PDT
Any updates?
Comment 3 Argyrios Kyrtzidis 2013-04-01 16:13:03 PDT
Should be fixed in r178500