[llvm] r206969 - [yaml2obj][ELF] Add a virtual destructor to the ELFYAML::Section class

David Blaikie dblaikie at gmail.com
Wed Apr 23 10:27:15 PDT 2014


How was this not producing compiler warnings... ?

On Wed, Apr 23, 2014 at 4:10 AM, Simon Atanasyan <simon at atanasyan.com> wrote:
> Author: atanasyan
> Date: Wed Apr 23 06:10:55 2014
> New Revision: 206969
>
> URL: http://llvm.org/viewvc/llvm-project?rev=206969&view=rev
> Log:
> [yaml2obj][ELF] Add a virtual destructor to the ELFYAML::Section class
> to prevent memory leaks.
>
> Modified:
>     llvm/trunk/include/llvm/Object/ELFYAML.h
>     llvm/trunk/lib/Object/ELFYAML.cpp
>
> Modified: llvm/trunk/include/llvm/Object/ELFYAML.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELFYAML.h?rev=206969&r1=206968&r2=206969&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Object/ELFYAML.h (original)
> +++ llvm/trunk/include/llvm/Object/ELFYAML.h Wed Apr 23 06:10:55 2014
> @@ -79,6 +79,7 @@ struct Section {
>    StringRef Info;
>    llvm::yaml::Hex64 AddressAlign;
>    Section(SectionKind Kind) : Kind(Kind) {}
> +  virtual ~Section();
>  };
>  struct RawContentSection : Section {
>    object::yaml::BinaryRef Content;
>
> Modified: llvm/trunk/lib/Object/ELFYAML.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/ELFYAML.cpp?rev=206969&r1=206968&r2=206969&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Object/ELFYAML.cpp (original)
> +++ llvm/trunk/lib/Object/ELFYAML.cpp Wed Apr 23 06:10:55 2014
> @@ -14,6 +14,9 @@
>  #include "llvm/Object/ELFYAML.h"
>
>  namespace llvm {
> +
> +ELFYAML::Section ::~Section() {}

unnecessary space between Section and ::?

> +
>  namespace yaml {
>
>  void
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list