+2011-03-22 Ivan Maidanski <ivmai@mail.ru>
+
+ * misc.c (GC_abort): Use _exit() (instead of DebugBreak) on Win32 when
+ doing code static analysis (to inform the tool that the function is
+ a no-return one).
+ * os_dep.c (GC_linux_stack_base): Remove a duplicate validation of the
+ length of "stat" file; use signed int type for "i", "buf_offset" and
+ "len" local variables (since read() may return -1).
+
2011-03-20 Ivan Maidanski <ivmai@mail.ru>
* blacklst.c (GC_bl_init_no_interiors): New function (the code
# ifndef LINT2
if (!msg) return; /* to suppress compiler warnings in ABORT callers. */
# endif
-# if defined(MSWIN32) && defined(NO_DEBUGGING)
+# if defined(MSWIN32) && (defined(NO_DEBUGGING) || defined(LINT2))
/* A more user-friendly abort after showing fatal message. */
_exit(-1); /* exit on error without running "at-exit" callbacks */
# elif defined(MSWINCE) && defined(NO_DEBUGGING)
char stat_buf[STAT_BUF_SIZE];
int f;
word result;
- size_t i, buf_offset = 0, len;
+ int i, buf_offset = 0, len;
/* First try the easy way. This should work for glibc 2.2 */
/* This fails in a prelinked ("prelink" command) executable */
}
# endif
f = open("/proc/self/stat", O_RDONLY);
- if (f < 0
- || (int)(len = (size_t)STAT_READ(f, stat_buf, STAT_BUF_SIZE))
- < 2 * STAT_SKIP) {
- ABORT("Couldn't read /proc/self/stat");
- }
+ if (f < 0)
+ ABORT("Couldn't read /proc/self/stat");
+ len = STAT_READ(f, stat_buf, STAT_BUF_SIZE);
close(f);
/* Skip the required number of fields. This number is hopefully */