summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2021-08-10 15:41:27 -0700
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:38 -0400
commited8aa3409a606a1c254eb94f7446827a11c66df2 (patch)
tree890313dd873a1cab3cc8156e5f73a04bd91daccd /bootstraptest
parent6d852e847e163fad0f2ccebe59c57d6921d3c472 (diff)
Detach mapping to local in ctx_set_local_type
Similar to the previous fix to ctx_clear_local_types, we must detach mappings to a local if we are changing its value.
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_yjit.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb
index a164b7a413..8b2d5b044e 100644
--- a/bootstraptest/test_yjit.rb
+++ b/bootstraptest/test_yjit.rb
@@ -1599,3 +1599,16 @@ assert_equal '10', %q{
val
}
+
+# regression test of local type change
+assert_equal '1.1', %q{
+def bar(baz, quux)
+ if baz.integer?
+ baz, quux = quux, nil
+ end
+ baz.to_s
+end
+
+bar(123, 1.1)
+bar(123, 1.1)
+}