summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/asan/asan_stack.cc
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2012-03-08 22:25:08 +0000
committerKostya Serebryany <kcc@google.com>2012-03-08 22:25:08 +0000
commitf7fc1d48595d946929908c2fb3658450b2a2cebe (patch)
tree6d6f49b9b6c7a13984bbefd15dc2bc18c7435ece /compiler-rt/lib/asan/asan_stack.cc
parent3bc40c5feee50214deba0a77ddc43443cff449f6 (diff)
downloadbcm5719-llvm-f7fc1d48595d946929908c2fb3658450b2a2cebe.tar.gz
bcm5719-llvm-f7fc1d48595d946929908c2fb3658450b2a2cebe.zip
[asan]: fix off-by-one error in stack unwinder (asan issue #44; reproduced thanks to 'csmith' fuzzer)
llvm-svn: 152347
Diffstat (limited to 'compiler-rt/lib/asan/asan_stack.cc')
-rw-r--r--compiler-rt/lib/asan/asan_stack.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler-rt/lib/asan/asan_stack.cc b/compiler-rt/lib/asan/asan_stack.cc
index 5dabc04a6f7..c3bca80542c 100644
--- a/compiler-rt/lib/asan/asan_stack.cc
+++ b/compiler-rt/lib/asan/asan_stack.cc
@@ -69,7 +69,7 @@ void AsanStackTrace::FastUnwindStack(uintptr_t pc, uintptr_t bp) {
uintptr_t *top = (uintptr_t*)t->stack_top();
uintptr_t *bottom = (uintptr_t*)t->stack_bottom();
while (frame >= prev_frame &&
- frame < top &&
+ frame < top - 2 &&
frame > bottom &&
size < max_size) {
uintptr_t pc1 = frame[1];
OpenPOWER on IntegriCloud