changeset 102300:d7ea9e8841d3

(read_escape): Signal an error for invalid \UXXXXXXXX.
author Kenichi Handa <handa@m17n.org>
date Fri, 27 Feb 2009 00:48:03 +0000
parents 668bf00f127d
children 3c208fc89683
files src/lread.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lread.c	Fri Feb 27 00:29:59 2009 +0000
+++ b/src/lread.c	Fri Feb 27 00:48:03 2009 +0000
@@ -2205,7 +2205,7 @@
       /* A Unicode escape. We only permit them in strings and characters,
 	 not arbitrarily in the source code, as in some other languages.  */
       {
-	int i = 0;
+	unsigned int i = 0;
 	int count = 0;
 
 	while (++count <= unicode_hex_count)
@@ -2222,7 +2222,8 @@
 		break;
 	      }
 	  }
-
+	if (i > 0x10FFFF)
+	  error ("Non-Unicode character: 0x%x", i);
 	return i;
       }