This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Fix agent expression constant sizing
- From: Stan Shebs <stanshebs at earthlink dot net>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Fri, 19 Mar 2010 11:26:54 -0700
- Subject: [PATCH] Fix agent expression constant sizing
A minor correction that improves bytecode efficiency slightly.
Committed to trunk.
Stan
2010-03-19 Stan Shebs <stan@codesourcery.com>
* ax-general.c (ax_const_l): Fix a sizing bug.
Index: ax-general.c
===================================================================
RCS file: /cvs/src/src/gdb/ax-general.c,v
retrieving revision 1.17
diff -p -r1.17 ax-general.c
*** ax-general.c 1 Jan 2010 07:31:30 -0000 1.17
--- ax-general.c 19 Mar 2010 18:18:49 -0000
*************** ax_const_l (struct agent_expr *x, LONGES
*** 231,237 ****
use the shortest representation. */
for (op = 0, size = 8; size < 64; size *= 2, op++)
{
! LONGEST lim = 1 << (size - 1);
if (-lim <= l && l <= lim - 1)
break;
--- 231,237 ----
use the shortest representation. */
for (op = 0, size = 8; size < 64; size *= 2, op++)
{
! LONGEST lim = ((LONGEST) 1) << (size - 1);
if (-lim <= l && l <= lim - 1)
break;