diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-05-22 14:57:42 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-05-22 14:57:42 +0000 |
commit | 431c73bc336b1d68171bc719af8a532078869c0f (patch) | |
tree | 3b71c8a3436e574a57b76c0a3be318add7efc3b1 /lib/Target/R600 | |
parent | dbd8eb26ce1e7de9b69f5c46f45ba011a706c9b9 (diff) |
Check that a function starts with llvm. before using GET_FUNCTION_RECOGNIZER.
Fixes a use of uninitialized memory found by asan and valgind.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182480 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/R600')
-rw-r--r-- | lib/Target/R600/AMDILIntrinsicInfo.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Target/R600/AMDILIntrinsicInfo.cpp b/lib/Target/R600/AMDILIntrinsicInfo.cpp index 4ddb057d80a..b92e528ff71 100644 --- a/lib/Target/R600/AMDILIntrinsicInfo.cpp +++ b/lib/Target/R600/AMDILIntrinsicInfo.cpp @@ -50,6 +50,9 @@ AMDGPUIntrinsicInfo::getName(unsigned int IntrID, Type **Tys, unsigned int AMDGPUIntrinsicInfo::lookupName(const char *Name, unsigned int Len) const { + if (!StringRef(Name, Len).startswith("llvm.")) + return 0; // All intrinsics start with 'llvm.' + #define GET_FUNCTION_RECOGNIZER #include "AMDGPUGenIntrinsics.inc" #undef GET_FUNCTION_RECOGNIZER |