[lld] r256309 - Fix two asan found bugs:

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 4 10:33:56 PST 2016


Cool!
I wonder if it makes sense to have a fuzzer for lld, similar to what we
have for clang and clang-format?

On Tue, Dec 22, 2015 at 5:06 PM, Rafael Espindola via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: rafael
> Date: Tue Dec 22 19:06:39 2015
> New Revision: 256309
>
> URL: http://llvm.org/viewvc/llvm-project?rev=256309&view=rev
> Log:
> Fix two asan found bugs:
>
> We were leaking InputFile subclasses data.
> UndefinedElf was missing a classof.
>
> Modified:
>     lld/trunk/ELF/InputFiles.cpp
>     lld/trunk/ELF/InputFiles.h
>     lld/trunk/ELF/Symbols.h
>
> Modified: lld/trunk/ELF/InputFiles.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=256309&r1=256308&r2=256309&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/InputFiles.cpp (original)
> +++ lld/trunk/ELF/InputFiles.cpp Tue Dec 22 19:06:39 2015
> @@ -31,6 +31,8 @@ public:
>  };
>  }
>
> +InputFile::~InputFile() {}
> +
>  template <class ELFT>
>  ELFFileBase<ELFT>::ELFFileBase(Kind K, MemoryBufferRef M)
>      : InputFile(K, M), ELFObj(MB.getBuffer(), ECRAII().getEC()) {}
>
> Modified: lld/trunk/ELF/InputFiles.h
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.h?rev=256309&r1=256308&r2=256309&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/InputFiles.h (original)
> +++ lld/trunk/ELF/InputFiles.h Tue Dec 22 19:06:39 2015
> @@ -35,6 +35,7 @@ class InputFile {
>  public:
>    enum Kind { ObjectKind, SharedKind, ArchiveKind };
>    Kind kind() const { return FileKind; }
> +  virtual ~InputFile();
>
>    StringRef getName() const { return MB.getBufferIdentifier(); }
>
>
> Modified: lld/trunk/ELF/Symbols.h
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.h?rev=256309&r1=256308&r2=256309&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/Symbols.h (original)
> +++ lld/trunk/ELF/Symbols.h Tue Dec 22 19:06:39 2015
> @@ -270,6 +270,10 @@ template <class ELFT> class UndefinedElf
>  public:
>    UndefinedElf(StringRef N, const Elf_Sym &Sym);
>    const Elf_Sym &Sym;
> +
> +  static bool classof(const SymbolBody *S) {
> +    return S->kind() == SymbolBody::UndefinedElfKind;
> +  }
>  };
>
>  template <class ELFT> class SharedSymbol : public Defined<ELFT> {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160104/d602eee0/attachment.html>


More information about the llvm-commits mailing list