diff options
author | Kevin Newton <kddnewton@gmail.com> | 2023-09-14 12:09:01 -0400 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-09-14 19:10:47 +0000 |
commit | 9d2549ac311f98288bd42c4a8054cba46ca8ce32 (patch) | |
tree | 043c94f52ae9854c2090029dd1d24d4ad9a91017 /test | |
parent | 63d1e056650293bb77f9a5c11600013afa801bba (diff) | |
download | ruby-9d2549ac311f98288bd42c4a8054cba46ca8ce32.tar.gz |
[ruby/yarp] Write names should not underflow size_t
If the read_name is invalid, we shouldn't try to set a write name.
https://github.com/ruby/yarp/commit/06881c8ca7
Diffstat (limited to 'test')
-rw-r--r-- | test/yarp/errors_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/yarp/errors_test.rb b/test/yarp/errors_test.rb index 99ae840565..4a269d79ec 100644 --- a/test/yarp/errors_test.rb +++ b/test/yarp/errors_test.rb @@ -1137,6 +1137,11 @@ module YARP assert_errors expected, "def foo(a = 1,b,*c);end", [["Unexpected parameter `*`", 16..17]] end + def test_invalid_message_name + result = YARP.parse("+.@foo,+=foo") + assert_equal "", result.value.statements.body.first.write_name + end + def test_invalid_operator_write_fcall source = "foo! += 1" assert_errors expression(source), source, [ |