From d3153992b4ae4df8d7c14ba3896389ae0cec29eb Mon Sep 17 00:00:00 2001
From: Martin Nilsson <nilsson@opera.com>
Date: Tue, 21 Oct 2014 15:51:38 +0200
Subject: [PATCH] Limit character constants to four bytes to be 32 bit
 architecture compatible.

---
 src/lexer.h      | 2 +-
 src/testsuite.in | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lexer.h b/src/lexer.h
index 189d0b4369..4a588369c1 100644
--- a/src/lexer.h
+++ b/src/lexer.h
@@ -860,7 +860,7 @@ unknown_directive:
             default:
               res <<= 8;
               res |= tmp;
-              if( ++l > 8 )
+              if( ++l > 4 )
               {
                 yyerror("Too large character constant.");
                 /* skip the rest of the characters. */
diff --git a/src/testsuite.in b/src/testsuite.in
index 81963da539..0d389d35f6 100644
--- a/src/testsuite.in
+++ b/src/testsuite.in
@@ -132,7 +132,7 @@ test_compile_error("\d109827346981234561823743412654")
 test_compile_error("\x109a27bc69e256c83deaa34c26b4")
 test_compile_error('\u17fo')
 test_compile_error("\u17fo")
-test_eq('\uu117f', 0x5c7531313766)
+test_compile_error('\uu117f', 0x5c7531313766)
 test_eq("\uuuu17fo", "\\uuu17fo")
 test_eq('\u117f', 0x117f)
 test_eq("\u117foo", "\10577oo")
-- 
GitLab