summaryrefslogtreecommitdiffstats
path: root/gcc/java/lex.c
diff options
context:
space:
mode:
authorapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-01 04:42:50 +0000
committerapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-01 04:42:50 +0000
commit4e0995d20fcd8b2b3f6e52e14798fd643363729a (patch)
treece404748d0a009ff1a1dd22dda9c089f55db3980 /gcc/java/lex.c
parentceb217a414961402d0e4d508ee736cfc913c24fc (diff)
downloadppe42-gcc-4e0995d20fcd8b2b3f6e52e14798fd643363729a.tar.gz
ppe42-gcc-4e0995d20fcd8b2b3f6e52e14798fd643363729a.zip
2001-08-30 Alexandre Petit-Bianco <apbianco@redhat.com>
* parse.y (patch_assignment): Don't verify final re-assignment here. (java_complete_lhs): Verify assignments to finals calling patch_assignment. Verify re-assignments to finals before calling patch_assignment. 2001-08-29 Alexandre Petit-Bianco <apbianco@redhat.com> * parse.y (java_complete_lhs): Allow final locals in CASE_EXPRs. Fixes PR java/1413 2001-08-28 Alexandre Petit-Bianco <apbianco@redhat.com> * lex.c (java_lex): new local found_hex_digits. Set and then used in test to reject invalid hexadecimal numbers. * parse.y (java_complete_tree): Prevent unwanted cast with initialized floating point finals. (patch_binop): Emit a warning when detecting a division by zero, mark result not constant, don't simplify non integer division. (http://gcc.gnu.org/ml/java-patches/2001-q3/msg00343.html ) git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45345 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/lex.c')
-rw-r--r--gcc/java/lex.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/java/lex.c b/gcc/java/lex.c
index 861b6eb54ef..d2214762632 100644
--- a/gcc/java/lex.c
+++ b/gcc/java/lex.c
@@ -991,6 +991,7 @@ java_lex (java_lval)
/* End borrowed section */
char literal_token [256];
int literal_index = 0, radix = 10, long_suffix = 0, overflow = 0, bytes;
+ int found_hex_digits = 0;
int i;
#ifndef JC1_LITE
int number_beginning = ctxp->c_line->current;
@@ -1060,6 +1061,10 @@ java_lex (java_lval)
int numeric = (RANGE (c, '0', '9') ? c-'0' : 10 +(c|0x20)-'a');
int count;
+ /* Remember when we find a valid hexadecimal digit */
+ if (radix == 16)
+ found_hex_digits = 1;
+
literal_token [literal_index++] = c;
/* This section of code if borrowed from gcc/c-lex.c */
for (count = 0; count < TOTAL_PARTS; count++)
@@ -1179,6 +1184,10 @@ java_lex (java_lval)
}
} /* JAVA_ASCCI_FPCHAR (c) */
+ if (radix == 16 && ! found_hex_digits)
+ java_lex_error
+ ("0x must be followed by at least one hexadecimal digit", 0);
+
/* Here we get back to converting the integral literal. */
if (c == 'L' || c == 'l')
long_suffix = 1;
OpenPOWER on IntegriCloud