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

Igor Kudrin via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 15 19:21:33 PST 2018


Hello Rafael,

I've checked it with asan and it caught that.

Best Regards,
Igor Kudrin
C++ Developer, Access Softek, Inc.

________________________________________
From: Rafael Avila de Espindola <rafael.espindola at gmail.com>
Sent: Thursday, February 15, 2018 11:45 PM
To: reviews+D34554+public+f400387c0a9ac696 at reviews.llvm.org; Igor Kudrin; ruiu at google.com; Evgeny Leviant
Cc: arichardson.kde at gmail.com; meadori at codesourcery.com; llvm-commits at lists.llvm.org; George Rimar; emaste at freebsd.org; pshung807 at gmail.com; adhemerval.zanella at linaro.org
Subject: Re: [PATCH] D34554: [ELF] FIx use-after-return of archive path

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

Which sanitizer would catch this? The original description was saying
"stack allocated", but it was a std::string, so it should be visible to
asan/valgrind, no?

Cheers,
Rafael


More information about the llvm-commits mailing list