From owner-svn-src-head@FreeBSD.ORG Sun Jun 30 21:06:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7426965B; Sun, 30 Jun 2013 21:06:48 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 66B141BF6; Sun, 30 Jun 2013 21:06:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5UL6mNV032836; Sun, 30 Jun 2013 21:06:48 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5UL6mw9032834; Sun, 30 Jun 2013 21:06:48 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201306302106.r5UL6mw9032834@svn.freebsd.org> From: Kai Wang Date: Sun, 30 Jun 2013 21:06:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252430 - head/lib/libdwarf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 21:06:48 -0000 Author: kaiw Date: Sun Jun 30 21:06:47 2013 New Revision: 252430 URL: http://svnweb.freebsd.org/changeset/base/252430 Log: When decoding SLEB128, make sure sign extension is performed for 64-bit integers. MFC after: 3 days Modified: head/lib/libdwarf/dwarf_init.c head/lib/libdwarf/dwarf_loc.c Modified: head/lib/libdwarf/dwarf_init.c ============================================================================== --- head/lib/libdwarf/dwarf_init.c Sun Jun 30 20:51:15 2013 (r252429) +++ head/lib/libdwarf/dwarf_init.c Sun Jun 30 21:06:47 2013 (r252430) @@ -192,7 +192,7 @@ dwarf_read_sleb128(Elf_Data **dp, uint64 shift += 7; } while ((b & 0x80) != 0); - if (shift < 32 && (b & 0x40) != 0) + if (shift < 64 && (b & 0x40) != 0) ret |= (-1 << shift); return ret; Modified: head/lib/libdwarf/dwarf_loc.c ============================================================================== --- head/lib/libdwarf/dwarf_loc.c Sun Jun 30 20:51:15 2013 (r252429) +++ head/lib/libdwarf/dwarf_loc.c Sun Jun 30 21:06:47 2013 (r252430) @@ -46,7 +46,7 @@ dwarf_decode_sleb128(uint8_t **dp) shift += 7; } while ((b & 0x80) != 0); - if (shift < 32 && (b & 0x40) != 0) + if (shift < 64 && (b & 0x40) != 0) ret |= (-1 << shift); *dp = src;