From 482e1f573ee45ef562cc6d218ba26d44660f8e0a Mon Sep 17 00:00:00 2001 From: nagachika Date: Fri, 10 Nov 2023 11:41:57 +0900 Subject: merge revision(s) 17b0643392749f45b7aacb64fc1c1bd704d42b4c: [Backport #19924] [Bug #19924] Source code should be unsigned char stream Use `peekc` or `nextc` to fetch the next character, instead of reading from `lex.pcur` directly, for compilers that plain char is signed. --- parse.y | 10 +++++----- test/ruby/test_parse.rb | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) --- test/ruby/test_parse.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/ruby/test_parse.rb') diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index a22f11aeae..f2691cfe0f 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -607,6 +607,8 @@ class TestParse < Test::Unit::TestCase assert_syntax_error("?\\M-\x01", 'Invalid escape character syntax') assert_syntax_error("?\\M-\\C-\x01", 'Invalid escape character syntax') assert_syntax_error("?\\C-\\M-\x01", 'Invalid escape character syntax') + + assert_equal("\xff", eval("# encoding: ascii-8bit\n""?\\\xFF")) end def test_percent -- cgit v1.2.3