Skip to content

Commit

Permalink
[crtbegin] Fix an off-by-1 bug in __do_fini
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D61367

llvm-svn: 359850
  • Loading branch information
MaskRay authored and MrSidims committed May 24, 2019
1 parent e045ad8 commit dac797a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler-rt/lib/crt/crtbegin.c
Expand Up @@ -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
}

Expand Down

0 comments on commit dac797a

Please sign in to comment.