diff options
| author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-03-23 13:42:49 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-23 13:42:49 -0700 |
| commit | b4e438d8aabaf4bba2b27f374c787543fae07c58 (patch) | |
| tree | ef14adb0d5e65098da72184071a52f0d1166f19a /test/ruby | |
| parent | 8286544dc5518f59bd607f6b6f8870fd22b3bac7 (diff) | |
YJIT: Save PC on rb_str_concat (#7586)
[Bug #19483]
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
Notes
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_yjit.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb index 703313f4ab..925efdf39f 100644 --- a/test/ruby/test_yjit.rb +++ b/test/ruby/test_yjit.rb @@ -1216,6 +1216,25 @@ class TestYJIT < Test::Unit::TestCase RUBY end + def test_str_concat_encoding_mismatch + assert_compiles(<<~'RUBY', result: "incompatible character encodings: ASCII-8BIT and EUC-JP") + def bar(a, b) + a << b + rescue => e + e.message + end + + def foo(a, b, h) + h[nil] + bar(a, b) # Ruby call, not set cfp->pc + end + + h = Hash.new { nil } + foo("\x80".b, "\xA1A1".force_encoding("EUC-JP"), h) + foo("\x80".b, "\xA1A1".force_encoding("EUC-JP"), h) + RUBY + end + private def code_gc_helpers |
