[LLVM] Uninitialized member in copy constructor in DataLayout.h

Peng Cheng gm4cheng at gmail.com
Tue Feb 26 20:37:21 PST 2013


The usual llvm regression tests for a standard constructor bug seems like
an overkill, leading to many wasteful code exercises, such as ir reading,
optimization, code generation, ...

Are there any other places to place the unit tests for classes in llvm code
base?  Simply to test whether all the necessary fields are initialized
after the copy constructor.


On Tue, Feb 26, 2013 at 10:51 PM, David Blaikie <dblaikie at gmail.com> wrote:

> On Tue, Feb 26, 2013 at 7:34 PM, Peng Cheng <gm4cheng at gmail.com> wrote:
> > It did not fail on any valgrind bots.  But when I used valgrind to check
> my
> > jit engine based on llvm, I found the bug.
> >
> > Could you point to me an example of test case for the valgrind bot?  I
> need
> > to see how the test infrastructure is setup in llvm.
>
> The current public valgrind bot (
> http://lab.llvm.org:8011/builders/clang-x86_64-linux-vg - there may be
> others) just runs the usual LLVM/Clang regression tests. So if you can
> construct a nice small/simple regression test you can add that (&
> limit the test to only running under valgrind, potentially)
>
> > On Tue, Feb 26, 2013 at 10:28 PM, David Blaikie <dblaikie at gmail.com>
> wrote:
> >>
> >> On Tue, Feb 26, 2013 at 7:15 PM, Peng Cheng <gm4cheng at gmail.com> wrote:
> >> > The copy constructor of class DataLayout fails to initialize
> >> > StackNaturalAlign.  It could lead to conditional jump on uninitialized
> >> > variables in member function exceedsNaturalStackAlignment.
> >>
> >> Does this fail any valgrind bots? Could you write a test case that
> >> would fail under valgrind?
> >>
> >> > See fix in the patch attached.
> >> >
> >> > _______________________________________________
> >> > llvm-commits mailing list
> >> > llvm-commits at cs.uiuc.edu
> >> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> >> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130226/70323a2a/attachment.html>


More information about the llvm-commits mailing list