diff options
| author | Alexey Samsonov <samsonov@google.com> | 2012-11-12 14:47:00 +0000 | 
|---|---|---|
| committer | Alexey Samsonov <samsonov@google.com> | 2012-11-12 14:47:00 +0000 | 
| commit | afc550d9484b2d29fdbeb2baf1a9792c8e77708c (patch) | |
| tree | 47f591c52c76ad8c881a2ed5fa73cf32eaf7dce2 /llvm/lib/Transforms | |
| parent | 9cb13d59b73a6b04466ad84a7c0e04d4d18413f8 (diff) | |
| download | bcm5719-llvm-afc550d9484b2d29fdbeb2baf1a9792c8e77708c.tar.gz bcm5719-llvm-afc550d9484b2d29fdbeb2baf1a9792c8e77708c.zip | |
[ASan] fixup for r167725: Don't fetch name of StructType if it is literal
llvm-svn: 167729
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/BlackList.cpp | 5 | 
1 files changed, 3 insertions, 2 deletions
| diff --git a/llvm/lib/Transforms/Instrumentation/BlackList.cpp b/llvm/lib/Transforms/Instrumentation/BlackList.cpp index 5b65ea66495..e02c631f7f7 100644 --- a/llvm/lib/Transforms/Instrumentation/BlackList.cpp +++ b/llvm/lib/Transforms/Instrumentation/BlackList.cpp @@ -97,8 +97,9 @@ static StringRef GetGVTypeString(const GlobalVariable &G) {    // Types of GlobalVariables are always pointer types.    Type *GType = G.getType()->getElementType();    // For now we support blacklisting struct types only. -  if (GType->isStructTy()) { -    return GType->getStructName(); +  if (StructType *SGType = dyn_cast<StructType>(GType)) { +    if (!SGType->isLiteral()) +      return SGType->getName();    }    return "<unknown type>";  } | 

