summaryrefslogtreecommitdiffstats
path: root/gdb/jv-exp.y
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2002-02-21 02:54:46 +0000
committerDaniel Jacobowitz <drow@false.org>2002-02-21 02:54:46 +0000
commit385fa495bfa18b350d21d71e4064359f96599ff0 (patch)
treecd61a4bc90cfc7781a40e9832debefed33cd08ba /gdb/jv-exp.y
parentedcc8c754b3bb1e366ea5f5b9d1832625f865e25 (diff)
downloadppe42-binutils-385fa495bfa18b350d21d71e4064359f96599ff0.tar.gz
ppe42-binutils-385fa495bfa18b350d21d71e4064359f96599ff0.zip
2002-02-20 Daniel Jacobowitz <drow@mvista.com>
* jv-exp.y (parse_number): Change type of implicit longs to builtin_type_uint64.
Diffstat (limited to 'gdb/jv-exp.y')
-rw-r--r--gdb/jv-exp.y9
1 files changed, 7 insertions, 2 deletions
diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y
index 403794e931..1b80ab4582 100644
--- a/gdb/jv-exp.y
+++ b/gdb/jv-exp.y
@@ -797,8 +797,13 @@ parse_number (p, len, parsed_float, putithere)
n += c;
}
- if (type == java_int_type && n > (ULONGEST)0xffffffff)
- type = java_long_type;
+ /* If the type is bigger than a 32-bit signed integer can be, implicitly
+ promote to long. Java does not do this, so mark it as builtin_type_uint64
+ rather than java_long_type. 0x80000000 will become -0x80000000 instead
+ of 0x80000000L, because we don't know the sign at this point.
+ */
+ if (type == java_int_type && n > (ULONGEST)0x80000000)
+ type = builtin_type_uint64;
putithere->typed_val_int.val = n;
putithere->typed_val_int.type = type;
OpenPOWER on IntegriCloud