Bug 527586 - ClassCastException in LocationCtxContainer.getSequenceNumberForOffset
Summary: ClassCastException in LocationCtxContainer.getSequenceNumberForOffset
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: Next   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-21 19:31 EST by EPP Error Reports CLA
Modified: 2020-09-04 15:25 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description EPP Error Reports CLA 2017-11-21 19:31:04 EST
The following problem was reported via the automated error reporting:

Message: Error while parsing /STM32746G_DISCOVERY/Application/User/Arial40.c.
java.lang.ClassCastException: org.eclipse.cdt.internal.core.parser.scanner.ASTMacroReferenceName cannot be cast to org.eclipse.cdt.internal.core.parser.scanner.LocationCtx
    at org.eclipse.cdt.internal.core.parser.scanner.LocationCtxContainer.getSequenceNumberForOffset(LocationCtxContainer.java:80)
    at org.eclipse.cdt.internal.core.parser.scanner.LocationMap.getSequenceNumberForFileOffset(LocationMap.java:701)
    at org.eclipse.cdt.internal.core.parser.scanner.ASTComment.getOffset(ASTPreprocessorNode.java:131)
    at org.eclipse.cdt.internal.core.dom.parser.ASTNode.getFileLocation(ASTNode.java:201)
    at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.extractReplacementHeaders(AbstractIndexerTask.java:1376)
    at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.writeToIndex(AbstractIndexerTask.java:1295)
    at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.parseFile(AbstractIndexerTask.java:1104)
    at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.parseLinkage(AbstractIndexerTask.java:899)
    at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.runTask(AbstractIndexerTask.java:560)
    at org.eclipse.cdt.internal.core.pdom.indexer.PDOMIndexerTask.run(PDOMIndexerTask.java:161)
    at org.eclipse.cdt.internal.core.pdom.PDOMIndexerJob.run(PDOMIndexerJob.java:155)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)



Bundles:
| org.eclipse.cdt.core | 6.2.0.201704050430 | 6.2.0.201704050430 |
| org.eclipse.core.jobs | 3.8.0.v20160509-0411 | 3.8.0.v20160509-0411 |

Operating Systems:
| Windows | 6.1.0 | 6.1.0 |


The above information is a snapshot of the collected data. Visit https://dev.eclipse.org/recommenders/committers/aeri/v2/#!/problems/5a0c5556e4b02aaf8b1fc8ff for the latest data.

Thank you for your assistance.
 Your friendly error-reports-inbox.


Created on behalf of zeratul976@xxxxxx.xxx
Comment 1 Nathan Ridge CLA 2017-11-21 19:32:06 EST
I'm not sure how this can even happen, seeing as the line that's throwing the CCE isn't even performing a cast, but if someone has a code example that reproduces this...