forked from OSchip/llvm-project
[libFuzzer] fix the stack-depth initialization, add a lit test for DeepRecursionTest.cpp
llvm-svn: 311421
This commit is contained in:
parent
f65cf64fa2
commit
33fb36c353
|
@ -343,8 +343,10 @@ void TracePC::ClearInlineCounters() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ATTRIBUTE_NO_SANITIZE_ALL
|
||||||
void TracePC::RecordInitialStack() {
|
void TracePC::RecordInitialStack() {
|
||||||
InitialStack = __sancov_lowest_stack;
|
int stack;
|
||||||
|
__sancov_lowest_stack = InitialStack = reinterpret_cast<uintptr_t>(&stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
uintptr_t TracePC::GetMaxStackOffset() const {
|
uintptr_t TracePC::GetMaxStackOffset() const {
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
# Test that we can find a stack overflow
|
||||||
|
RUN: %cpp_compiler -fsanitize-coverage=stack-depth %S/DeepRecursionTest.cpp -o %t
|
||||||
|
RUN: not %t -seed=1 -runs=100000000 2>&1 | FileCheck %s
|
||||||
|
CHECK: ERROR: libFuzzer: deadly signal
|
Loading…
Reference in New Issue