about summary refs log tree commit diff homepage
path: root/runtime/klee-libc/__cxa_atexit.c
diff options
context:
space:
mode:
authorTomas Jasek <tomsik68@posteo.net>2020-10-26 18:28:10 +0100
committerCristian Cadar <c.cadar@imperial.ac.uk>2020-10-30 14:53:29 +0000
commit909bca0e15282a56e3345850fb23a8f16c9e39e6 (patch)
treede434d99bfd28a6b750bb3a982fdc2896dc08316 /runtime/klee-libc/__cxa_atexit.c
parentbd317816647a870e64fecde5096cc3a0c2b50370 (diff)
downloadklee-909bca0e15282a56e3345850fb23a8f16c9e39e6.tar.gz
Call functions in __cxa_atexit in reverse order
Diffstat (limited to 'runtime/klee-libc/__cxa_atexit.c')
-rw-r--r--runtime/klee-libc/__cxa_atexit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/klee-libc/__cxa_atexit.c b/runtime/klee-libc/__cxa_atexit.c
index eb0c3e41..027c2d0a 100644
--- a/runtime/klee-libc/__cxa_atexit.c
+++ b/runtime/klee-libc/__cxa_atexit.c
@@ -22,7 +22,7 @@ static void RunAtExit(void) __attribute__((destructor));
 static void RunAtExit(void) {
   unsigned i;
 
-  for (i=0; i<NumAtExit; ++i)
+  for (i = NumAtExit - 1; i < MAX_ATEXIT; --i)
     AtExit[i].fn(AtExit[i].arg);
 }