Source-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: src/usr.bin/xlint/lint1
Module Name: src
Committed By: rillig
Date: Sat Apr 22 20:17:19 UTC 2023
Modified Files:
src/usr.bin/xlint/lint1: debug.c tree.c
Log Message:
lint: fix missing initialization for cast to union
The left operand of a unary AST node must not be NULL.
The previous code crashed lint when run with some query enabled, as
is_cast_redundant assumes that a non-null AST node has valid operands.
$ cat <<EOF > crash.c
double
demo(void) {
union u {
double *num;
} u;
u = (union u)&((double) { 0.0 });
return *u.num;
}
EOF
$ /usr/libexec/lint1 -w -S -g -q8 crash.c /dev/null
To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/xlint/lint1/debug.c
cvs rdiff -u -r1.517 -r1.518 src/usr.bin/xlint/lint1/tree.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Home |
Main Index |
Thread Index |
Old Index