Fix segfault from https://bugs.kde.org/show_bug.cgi?id=381123
This aborts parsing if the top context doesn't exist.
Still need to figure out how it ends there...
Details
Details
- Reviewers
kfunk
Diff Detail
Diff Detail
- Repository
- R52 KDevelop: PHP Support
- Branch
- master
- Lint
No Linters Available - Unit
No Unit Test Coverage
Comment Actions
Maybe you could add a unit test?
duchain/builders/typebuilder.cpp | ||
---|---|---|
517 | if (classDec->internalContext()) |
Comment Actions
- revert your patch
- add a test case parsing your test case from https://bugs.kde.org/show_bug.cgi?id=381123#c2 -- make sure running the test case inhibits a crash
- reduce the test case as much as possible
3.1) bonus points for actually figuring out why internalContext is nullptr
- reapply your patch, make sure running the test no longer crashes
duchain/builders/typebuilder.cpp | ||
---|---|---|
517 | if (auto internalContext = classDec->internalContext()) { foreach (Declaration *d, internalContext->findDeclarations(currentQId)) { |