Home | History | Annotate | Download | only in common
History log of /src/usr.bin/xlint/common/mem.c
RevisionDateAuthorComments
 1.25  20-Jan-2024  rillig lint: clean up
 1.24  20-Jan-2024  rillig lint: unclutter conditional compilation
 1.23  20-Jan-2024  rillig lint: only define xcalloc if actually used
 1.22  13-Jul-2023  rillig lint: indent copyright lines consistently
 1.21  13-Jan-2023  rillig lint: remove custom memory allocator

Besides adding complexity, the custom memory allocator didn't invalidate
freed memory, which made it harder to find possible use-after-free bugs.
 1.20  20-May-2022  rillig lint: use __RCSID in lint mode as well

Since 1995-10-02, lint supports __asm statements and __asm modifiers.

No binary change.
 1.19  31-Aug-2021  rillig lint: fix memory allocation (since 2021-08-28)

In mem1.c 1.50 and mem2.c 1.13 from 2021-08-28, I accidentally changed
the initialization of mblklen from round_up to round_down, trying to
avoid a division instruction.

On NetBSD x86_64 this resulted in a few more malloc calls, but on Cygwin
with its 64k pagesize, mblklen became 0. Later, the function xalloc in
lint2 called xalloc(mblklen) and blindly assumed that the returned
memory would be large enough. This in turn led to out-of-bounds memory
access and crashes. Lint1 was not affected since it adjust mblklen
during runtime if it gets too small.
 1.18  28-Aug-2021  rillig lint: explicitly ignore return value of some function calls

This fixes the warning from lint2 that these functions return values
which are sometimes ignored.

The remaining calls to fprintf that ignore the return value come from
scan.c. Lint does not currently detect the auto-generated portions of
that file and the interesting ones since it assumes that scan.c is the
main filename, see expr_zalloc_tnode.

No functional change.
 1.17  22-Aug-2021  rillig lint: only include code in the binaries that is actually used

No functional change.
 1.16  03-Aug-2021  rillig lint: make memory management code easier to read

No functional change.
 1.15  01-Aug-2021  rillig lint: make xasprintf simpler

No functional change.
 1.14  01-Aug-2021  rillig lint: unexport nomem

No functional change.
 1.13  01-Aug-2021  rillig lint: remove xmapalloc

Just trust the standard malloc to be smart enough.

No functional change.
 1.12  18-Apr-2021  rillig lint: remove WARNS=3, falling back to the default WARNS=5

It's strange that GCC does not warn about the nonliteral format strings
in lint1/err.c, lint2/msg.c and lint2/read.c, despite -Wformat=2, but
Clang does.
 1.11  29-Dec-2020  rillig lint: remove redundant parentheses around return value
 1.10  28-Dec-2020  rillig lint: remove trailing whitespace
 1.9  28-Dec-2020  rillig lint: spell check
 1.8  10-Feb-2020  christos use asprintf().
 1.7  20-Jun-2004  jmc branches: 1.7.92;
Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
 1.6  22-Oct-2003  christos branches: 1.6.2;
- keep the fd to /dev/zero open
- take advantage of MAP_ANONYMOUS
 1.5  21-Oct-2003  christos PR/23219: Dan McMahill: Make this compile on system that don't have MAP_ANON.
Centralize the mmap allocations in a new function, xmapalloc() that handles
this.
 1.4  16-Oct-2003  itojun safer use of realloc
 1.3  31-Jan-2002  tv Protect __RCSID and __COPYRIGHT from being invoked if not defined.
 1.2  21-Jan-2002  tv Add hooks for compiling on non-NetBSD hosts.
 1.1  18-Jan-2002  thorpej * Move stuff shared between lint1 and lint2 to the new common/ directory.
* Move the arch/ directory out of lint1/ into the top-level.
 1.6.2.1  22-Jun-2004  tron Pull up revision 1.7 (requested by jmc in ticket #527):
Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')
Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).
Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.
Fixes PR's: PR#17762 PR#25944
 1.7.92.1  08-Apr-2020  martin Merge changes from current as of 20200406

RSS XML Feed