[PATCH] D61367: [crtbegin] Fix an off-by-1 bug in __do_fini

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 2 17:09:53 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rCRT359850: [crtbegin] Fix an off-by-1 bug in __do_fini (authored by MaskRay, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D61367?vs=197511&id=197897#toc

Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61367/new/

https://reviews.llvm.org/D61367

Files:
  lib/crt/crtbegin.c


Index: lib/crt/crtbegin.c
===================================================================
--- lib/crt/crtbegin.c
+++ lib/crt/crtbegin.c
@@ -77,7 +77,7 @@
     __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
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61367.197897.patch
Type: text/x-patch
Size: 390 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190503/6e84141a/attachment.bin>


More information about the llvm-commits mailing list