summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-05-03 00:11:53 +0000
committerFangrui Song <maskray@google.com>2019-05-03 00:11:53 +0000
commit2f57e2cad9ee1097caabb63ada236fd77748fac1 (patch)
tree544ff20abd9097b587e531179d68472498ac8bd1
parent812af4fe74be9ff410d919ffe183e85842b41ab0 (diff)
downloadcompiler-rt-2f57e2cad9ee1097caabb63ada236fd77748fac1.tar.gz
[crtbegin] Fix an off-by-1 bug in __do_fini
Differential Revision: https://reviews.llvm.org/D61367 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@359850 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/crt/crtbegin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/crt/crtbegin.c b/lib/crt/crtbegin.c
index 523ff6fe3..cfbe5e520 100644
--- a/lib/crt/crtbegin.c
+++ b/lib/crt/crtbegin.c
@@ -77,7 +77,7 @@ static void __attribute__((used)) __do_fini() {
__deregister_frame_info(__EH_FRAME_LIST__);
const size_t n = __DTOR_LIST_END__ - __DTOR_LIST__ - 1;
- for (size_t i = 1; i < n; i++) __DTOR_LIST__[i]();
+ for (size_t i = 1; i <= n; i++) __DTOR_LIST__[i]();
#endif
}