[PATCH] D34554: [ELF] FIx use-after-return of archive path

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 15 09:00:58 PST 2018


Igor Kudrin via Phabricator <reviews at reviews.llvm.org> writes:

>
> Index: test/ELF/whole-archive-name.s
> ===================================================================
> --- /dev/null
> +++ test/ELF/whole-archive-name.s
> @@ -0,0 +1,15 @@
> +// REQUIRES: x86
> +// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
> +// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux \
> +// RUN:   %p/Inputs/whole-archive-name.s -o %tfoo.o
> +// RUN: mkdir -p %t.dir
> +// RUN: rm -f %t.dir/libfoo.a
> +// RUN: llvm-ar rcs %t.dir/libfoo.a %tfoo.o
> +// RUN: ld.lld -L%t.dir %t.o --whole-archive -lfoo -o %t -Map=- | FileCheck %s


Add a comment saying that there was an use after free and valgrind/asan
would detect it.

LGTM with that.

Cheers,
Rafael


More information about the llvm-commits mailing list