Module Name: src
Committed By: christos
Date: Sun Oct 31 16:42:16 UTC 2021
Modified Files:
src/usr.bin/xlint/lint1: tree.c
Log Message:
Avoid null pointer exception hpcmips/mipsel src/lib/libperfuse/ops.c
To generate a diff of this commit:
cvs rdiff -u -r1.386 -r1.387 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/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.386 src/usr.bin/xlint/lint1/tree.c:1.387
--- src/usr.bin/xlint/lint1/tree.c:1.386 Sat Oct 30 18:04:42 2021
+++ src/usr.bin/xlint/lint1/tree.c Sun Oct 31 12:42:16 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.386 2021/10/30 22:04:42 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.387 2021/10/31 16:42:16 christos 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.386 2021/10/30 22:04:42 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.387 2021/10/31 16:42:16 christos Exp $");
#endif
#include <float.h>
@@ -1793,6 +1793,9 @@ check_enum_array_index(const tnode_t *ln
return;
if (rn->tn_left->tn_type->t_tspec != ENUM)
return;
+ // XXX: why?
+ if (rn->tn_type->t_enum == NULL)
+ return;
max_enum_value = INT_MIN;
ec = rn->tn_type->t_enum->en_first_enumerator;