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 type conversion for very large...



details:   https://anonhg.NetBSD.org/src/rev/2b97aee598fe
branches:  trunk
changeset: 980276:2b97aee598fe
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jan 30 18:14:25 2021 +0000

description:
lint: fix type conversion for very large data types

Data types that are 4 GB or larger are an edge case.  Nevertheless,
compute their size correctly.

diffstat:

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

diffs (28 lines):

diff -r 622149090c30 -r 2b97aee598fe usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Sat Jan 30 18:12:07 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Sat Jan 30 18:14:25 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.192 2021/01/30 18:12:07 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.193 2021/01/30 18:14:25 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.192 2021/01/30 18:12:07 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.193 2021/01/30 18:14:25 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -3381,8 +3381,7 @@
                break;
        }
 
-       /* XXX: type conversion is too late */
-       return (int64_t)(elem * elsz);
+       return (int64_t)elem * elsz;
 }
 
 tnode_t *



Home | Main Index | Thread Index | Old Index