Module Name: src
Committed By: rillig
Date: Sat Jan 16 19:03:47 UTC 2021
Modified Files:
src/usr.bin/xlint/lint1: ops.def tree.c
Log Message:
lint: in strict bool mode, perform the normal checks as well
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/xlint/lint1/ops.def
cvs rdiff -u -r1.161 -r1.162 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.
Modified files:
Index: src/usr.bin/xlint/lint1/ops.def
diff -u src/usr.bin/xlint/lint1/ops.def:1.11 src/usr.bin/xlint/lint1/ops.def:1.12
--- src/usr.bin/xlint/lint1/ops.def:1.11 Fri Jan 15 22:07:54 2021
+++ src/usr.bin/xlint/lint1/ops.def Sat Jan 16 19:03:47 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ops.def,v 1.11 2021/01/15 22:07:54 rillig Exp $ */
+/* $NetBSD: ops.def,v 1.12 2021/01/16 19:03:47 rillig Exp $ */
begin_ops()
@@ -71,7 +71,7 @@ op( CVT, "convert", , , , , , , , , ,1,
op( ICALL, "icall", 1, , , , , , , , , , , ,1, , , , , , , ,1)
op( LOAD, "load", , , , , , , , , , , , , , , , , , , , ,1)
op( PUSH, "push", , , , , , , , , ,1, , , , , , , , , , ,1)
-op( RETURN, "return", 1, , , , , , , , , , , ,1, , , , ,1, , ,1)
+op( RETURN, "return", 1, ,1, , , , , , , , , ,1, , , , ,1, , ,1)
op( REAL, "real", , , , , , , , , , , , , , , , , , , , ,0)
op( IMAG, "imag", , , , , , , , , , , , , , , , , , , , ,0)
@@ -79,7 +79,7 @@ op( IMAG, "imag", , , , , , , , , , ,
/* name repr b l b o i c a s f v t b s l r p c e e = act */
op( INIT, "init", 1, ,1, , , , , , , , , , , , , , ,1, , ,1)
op( CASE, "case", , , , , , , , , , , , , , , , , , , , ,0)
-op( FARG, "farg", 1, , , , , , , , , , , , , , , , ,1, , ,1)
+op( FARG, "farg", 1, ,1, , , , , , , , , , , , , , ,1, , ,1)
end_ops()
Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.161 src/usr.bin/xlint/lint1/tree.c:1.162
--- src/usr.bin/xlint/lint1/tree.c:1.161 Sat Jan 16 18:58:21 2021
+++ src/usr.bin/xlint/lint1/tree.c Sat Jan 16 19:03:47 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.161 2021/01/16 18:58:21 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.162 2021/01/16 19:03:47 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.161 2021/01/16 18:58:21 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.162 2021/01/16 19:03:47 rillig Exp $");
#endif
#include <float.h>
@@ -1144,8 +1144,9 @@ typeok_scalar_strict_bool(op_t op, const
rt = NOTSPEC;
}
- if (needs_compatible_types(op))
- return typeok_strict_bool_compatible(op, arg, lt, rt);
+ if (needs_compatible_types(op) &&
+ !typeok_strict_bool_compatible(op, arg, lt, rt))
+ return false;
if (mp->m_takes_only_bool || op == QUEST) {
bool binary = mp->m_binary;