[compiler-rt] r260876 - Fixed non-NULL terminating array bug in SanitizerCommon.StartSubprocessTest that caused them to fail sometimes and act flaky.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 16 16:32:16 PST 2016


On Sun, Feb 14, 2016 at 9:11 PM, Zia Ansari via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: zansari
> Date: Sun Feb 14 23:11:51 2016
> New Revision: 260876
>
> URL: http://llvm.org/viewvc/llvm-project?rev=260876&view=rev
> Log:
> Fixed non-NULL terminating array bug in
> SanitizerCommon.StartSubprocessTest that caused them to fail sometimes and
> act flaky.
>
> Differential Revision: http://reviews.llvm.org/D17228
>
>
> Modified:
>     compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_linux_test.cc
>
> Modified:
> compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_linux_test.cc
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_linux_test.cc?rev=260876&r1=260875&r2=260876&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_linux_test.cc
> (original)
> +++ compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_linux_test.cc
> Sun Feb 14 23:11:51 2016
> @@ -271,7 +271,7 @@ TEST(SanitizerCommon, StartSubprocessTes
>  #else
>    const char *shell = "/bin/sh";
>  #endif
> -  const char *argv[] = {shell, "-c", "echo -n 'hello'"};
> +  const char *argv[] = {shell, "-c", "echo -n 'hello'", (char *)NULL};
>

Is the cast required here and/or could you use nullptr?


>    int pid = StartSubprocess(shell, argv,
>                              /* stdin */ kInvalidFd, /* stdout */
> pipe_fds[1]);
>    ASSERT_GT(pid, 0);
>
>
> _______________________________________________
> 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/20160216/4a6cbc15/attachment.html>


More information about the llvm-commits mailing list