mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-05 04:38:37 +00:00
Fixup for r220403: Use getFileLoc() instead of getSpellingLoc() in SanitizerBlacklist.
This also handles the case where function name (not its body) is obtained from macro expansion. llvm-svn: 220407
This commit is contained in:
parent
13491c4f24
commit
6d87ce8bd5
@ -41,6 +41,6 @@ bool SanitizerBlacklist::isBlacklistedFile(StringRef FileName,
|
||||
bool SanitizerBlacklist::isBlacklistedLocation(SourceLocation Loc,
|
||||
StringRef Category) const {
|
||||
return !Loc.isInvalid() &&
|
||||
isBlacklistedFile(SM.getFilename(SM.getSpellingLoc(Loc)), Category);
|
||||
isBlacklistedFile(SM.getFilename(SM.getFileLoc(Loc)), Category);
|
||||
}
|
||||
|
||||
|
@ -66,13 +66,19 @@ int BlacklistedFunction(int *a) { return *a; }
|
||||
|
||||
#define GENERATE_FUNC(name) \
|
||||
int name(int *a) { return *a; }
|
||||
|
||||
// WITHOUT: GeneratedFunction{{.*}}) [[NOATTR]]
|
||||
// BLFILE: GeneratedFunction{{.*}}) [[NOATTR]]
|
||||
// BLFUNC: GeneratedFunction{{.*}}) [[WITH]]
|
||||
// ASAN: GeneratedFunction{{.*}}) [[WITH]]
|
||||
GENERATE_FUNC(GeneratedFunction)
|
||||
|
||||
#define GENERATE_NAME(name) name##_generated
|
||||
// WITHOUT: Function_generated{{.*}}) [[NOATTR]]
|
||||
// BLFILE: Function_generated{{.*}}) [[NOATTR]]
|
||||
// BLFUNC: Function_generated{{.*}}) [[WITH]]
|
||||
// ASAN: Function_generated{{.*}}) [[WITH]]
|
||||
int GENERATE_NAME(Function)(int *a) { return *a; }
|
||||
|
||||
// WITHOUT: TemplateAddressSafetyOk{{.*}}) [[NOATTR]]
|
||||
// BLFILE: TemplateAddressSafetyOk{{.*}}) [[NOATTR]]
|
||||
// BLFUNC: TemplateAddressSafetyOk{{.*}}) [[WITH]]
|
||||
|
Loading…
Reference in New Issue
Block a user