From owner-svn-src-all@freebsd.org Sat Mar 18 07:01:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53EEBD11F96; Sat, 18 Mar 2017 07:01:20 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 218E01534; Sat, 18 Mar 2017 07:01:20 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2I71JSg086313; Sat, 18 Mar 2017 07:01:19 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2I71Jgc086312; Sat, 18 Mar 2017 07:01:19 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201703180701.v2I71Jgc086312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sat, 18 Mar 2017 07:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315477 - head/sys/ddb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Mar 2017 07:01:20 -0000 Author: bde Date: Sat Mar 18 07:01:18 2017 New Revision: 315477 URL: https://svnweb.freebsd.org/changeset/base/315477 Log: Fix right shifts on arches with db_expr_t larger than u_int (LP64 arches in practice). db_expr_t is a signed type, but right shifts are fudged to evaluate them in an unsigned type, and the unsigned type was broken by hard- coding it as 'unsigned', so casting to it lost the top bits on arches with db_expr_t larger than u_int. The unsigned type with the same size as db_expr_t is not declared; assume that db_addr_t gives it. Fixing this properly is less important than using the correct type for db_expr_t (originally always long for C90, but always intmax_t since C99). Modified: head/sys/ddb/db_expr.c Modified: head/sys/ddb/db_expr.c ============================================================================== --- head/sys/ddb/db_expr.c Sat Mar 18 06:05:54 2017 (r315476) +++ head/sys/ddb/db_expr.c Sat Mar 18 07:01:18 2017 (r315477) @@ -261,7 +261,7 @@ db_shift_expr(db_expr_t *valuep) lhs <<= rhs; else { /* Shift right is unsigned */ - lhs = (unsigned) lhs >> rhs; + lhs = (db_addr_t)lhs >> rhs; } t = db_read_token(); }