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: fix assertion failure in display_e...



details:   https://anonhg.NetBSD.org/src/rev/887d1b586980
branches:  trunk
changeset: 984332:887d1b586980
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jul 03 20:40:17 2021 +0000

description:
lint: fix assertion failure in display_expression for bool constants

diffstat:

 usr.bin/xlint/lint1/tree.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 560ee9558d2a -r 887d1b586980 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Sat Jul 03 19:39:07 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Sat Jul 03 20:40:17 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.303 2021/06/30 14:42:13 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.304 2021/07/03 20:40:17 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.303 2021/06/30 14:42:13 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.304 2021/07/03 20:40:17 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -3785,6 +3785,9 @@
                (void)printf("0x %08lx %08lx ",
                    (long)(uq >> 32) & 0xffffffffl,
                    (long)uq & 0xffffffffl);
+       } else if (tn->tn_op == CON && tn->tn_type->t_tspec == BOOL) {
+               (void)printf("%s ",
+                   tn->tn_val->v_quad != 0 ? "true" : "false");
        } else if (tn->tn_op == CON) {
                lint_assert(tn->tn_type->t_tspec == PTR);
                (void)printf("0x%0*lx ", (int)(sizeof(void *) * CHAR_BIT / 4),



Home | Main Index | Thread Index | Old Index