Make print_float_info() multi-arch pure. Add ui_file and frame parameters.
[deliverable/binutils-gdb.git] / gdb / jv-exp.y
index 403794e9319eb2192829e60ee1f4a61038b03ddb..495bf3e05379b53a16c14944039e6832dbef66c0 100644 (file)
@@ -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;
@@ -857,6 +862,8 @@ yylex ()
   
  retry:
 
+  prev_lexptr = lexptr;
+
   tokstart = lexptr;
   /* See if it is a special token of length 3.  */
   for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
@@ -1202,6 +1209,9 @@ void
 yyerror (msg)
      char *msg;
 {
+  if (prev_lexptr)
+    lexptr = prev_lexptr;
+
   error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
 }
 
This page took 0.023914 seconds and 4 git commands to generate.