mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-01 14:46:26 +00:00
[libclang] Add missing return in clang_getExpansionLocation that resulted in that function
always returning a null file/line/column. Also add at least one use of clang_getExpansionLocation inside c-index-test that would have made the tests to catch that. llvm-svn: 143606
This commit is contained in:
parent
e968152564
commit
7ca77357ce
@ -340,7 +340,7 @@ static const char* GetCursorSource(CXCursor Cursor) {
|
||||
CXSourceLocation Loc = clang_getCursorLocation(Cursor);
|
||||
CXString source;
|
||||
CXFile file;
|
||||
clang_getSpellingLocation(Loc, &file, 0, 0, 0);
|
||||
clang_getExpansionLocation(Loc, &file, 0, 0, 0);
|
||||
source = clang_getFileName(file);
|
||||
if (!clang_getCString(source)) {
|
||||
clang_disposeString(source);
|
||||
|
@ -212,6 +212,7 @@ void clang_getExpansionLocation(CXSourceLocation location,
|
||||
*column = SM.getExpansionColumnNumber(ExpansionLoc);
|
||||
if (offset)
|
||||
*offset = SM.getDecomposedLoc(ExpansionLoc).second;
|
||||
return;
|
||||
}
|
||||
|
||||
// FIXME:
|
||||
|
Loading…
x
Reference in New Issue
Block a user