Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint1 lint: in strict bool mode, perform the n...



details:   https://anonhg.NetBSD.org/src/rev/0448ebf20dd5
branches:  trunk
changeset: 958673:0448ebf20dd5
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jan 16 19:03:47 2021 +0000

description:
lint: in strict bool mode, perform the normal checks as well

diffstat:

 usr.bin/xlint/lint1/ops.def |  6 +++---
 usr.bin/xlint/lint1/tree.c  |  9 +++++----
 2 files changed, 8 insertions(+), 7 deletions(-)

diffs (57 lines):

diff -r f3dc8f70b6bb -r 0448ebf20dd5 usr.bin/xlint/lint1/ops.def
--- a/usr.bin/xlint/lint1/ops.def       Sat Jan 16 18:58:21 2021 +0000
+++ b/usr.bin/xlint/lint1/ops.def       Sat Jan 16 19:03:47 2021 +0000
@@ -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(    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 @@
 /*     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()
 
diff -r f3dc8f70b6bb -r 0448ebf20dd5 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Sat Jan 16 18:58:21 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Sat Jan 16 19:03:47 2021 +0000
@@ -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 @@
                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;



Home | Main Index | Thread Index | Old Index