You've already forked linux-packaging-mono
acceptance-tests
data
debian
docs
external
Newtonsoft.Json
api-doc-tools
api-snapshot
aspnetwebstack
bdwgc
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
helix-binaries
ikdasm
ikvm
illinker-test-assets
linker
llvm-project
clang
clang-tools-extra
compiler-rt
cmake
docs
include
lib
test
BlocksRuntime
asan
builtins
cfi
dfsan
esan
fuzzer
hwasan
interception
lsan
msan
profile
safestack
CMakeLists.txt
buffer-copy-vla.c
buffer-copy.c
canary.c
init.c
lit.cfg
lit.site.cfg.in
lto.c
overflow.c
pthread-cleanup.c
pthread.c
utils.h
sanitizer_common
scudo
tsan
ubsan
ubsan_minimal
xray
CMakeLists.txt
lit.common.cfg
lit.common.configured.in
unittests
www
.arcconfig
.gitignore
CMakeLists.txt
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
README.txt
eng
libcxx
libcxxabi
libunwind
lld
lldb
llvm
nuget
openmp
polly
Directory.Build.props
Directory.Build.targets
NuGet.config
azure-pipelines.yml
build.cmd
build.sh
dir.common.props
global.json
llvm.proj
mxe-Win64.cmake.in
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
how-to-bump-roslyn-binaries.md
ikvm-native
llvm
m4
man
mcs
mono
msvc
netcore
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
30 lines
578 B
C
30 lines
578 B
C
![]() |
// RUN: %clang_safestack %s -o %t
|
||
|
// RUN: %run %t
|
||
|
|
||
|
// RUN: %clang_nosafestack -fno-stack-protector %s -o %t
|
||
|
// RUN: not %run %t
|
||
|
|
||
|
// Test that buffer overflows on the unsafe stack do not affect variables on the
|
||
|
// safe stack.
|
||
|
|
||
|
// REQUIRES: stable-runtime
|
||
|
|
||
|
__attribute__((noinline))
|
||
|
void fct(volatile int *buffer)
|
||
|
{
|
||
|
memset(buffer - 1, 0, 7 * sizeof(int));
|
||
|
}
|
||
|
|
||
|
int main(int argc, char **argv)
|
||
|
{
|
||
|
int prebuf[7];
|
||
|
int value1 = 42;
|
||
|
int buffer[5];
|
||
|
int value2 = 42;
|
||
|
int postbuf[7];
|
||
|
fct(prebuf + 1);
|
||
|
fct(postbuf + 1);
|
||
|
fct(buffer);
|
||
|
return value1 != 42 || value2 != 42;
|
||
|
}
|