SourceManager invalid index error

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SourceManager invalid index error

madil90
Hi,
   I am parsing a few files and using the following code to extract the buffers for those files

for (it = rewriter.buffer_begin(); it != rewriter.buffer_end(); it ++)
    const FileEntry* fileEntry = sourceManager.getFileEntryForID(it->first);


   I keep getting the following error. Can you please explain what this means and what might be causing this error. Thanks for your help.

const clang::SrcMgr::SLocEntry& clang::SourceManager::getLocalSLocEntry(unsigned int, bool*) const: Assertion 'Index < LocalSLocEntryTable.size() && "Invalid Index"' failed.
Reply | Threaded
Open this post in threaded view
|

Re: SourceManager invalid index error

Vane, Edwin
How did you create the rewriter? Is it using the same SourceManager as you're then using to get buffers? If not, keep in mind the FileIDs from one SourceManager don't mean anything to any other SourceManager.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of madil90
Sent: Thursday, February 07, 2013 2:24 PM
To: [hidden email]
Subject: [cfe-dev] SourceManager invalid index error

Hi,
   I am parsing a few files and using the following code to extract the buffers for those files

*for (it = rewriter.buffer_begin(); it != rewriter.buffer_end(); it ++)
    const FileEntry* fileEntry =
sourceManager.getFileEntryForID(it->first);*

   I keep getting the following error. Can you please explain what this means and what might be causing this error. Thanks for your help.

*const clang::SrcMgr::SLocEntry&
clang::SourceManager::getLocalSLocEntry(unsigned int, bool*) const:
Assertion 'Index < LocalSLocEntryTable.size() && "Invalid Index"' failed.*



--
View this message in context: http://clang-developers.42468.n3.nabble.com/SourceManager-invalid-index-error-tp4030362.html
Sent from the Clang Developers mailing list archive at Nabble.com.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev