mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
GH-123996: Explicitly mark 'self_or_null' as an array of size 1 to ensure that it is kept in memory for calls (GH-124003)
This commit is contained in:
parent
3ea51fa2e3
commit
4ed7d1d6ac
7 changed files with 344 additions and 327 deletions
|
@ -1110,6 +1110,44 @@ class TestGeneratedCases(unittest.TestCase):
|
|||
"""
|
||||
self.run_cases_test(input, output)
|
||||
|
||||
def test_scalar_array_inconsistency(self):
|
||||
|
||||
input = """
|
||||
op(FIRST, ( -- a)) {
|
||||
a = 1;
|
||||
}
|
||||
|
||||
op(SECOND, (a[1] -- b)) {
|
||||
b = 1;
|
||||
}
|
||||
|
||||
macro(TEST) = FIRST + SECOND;
|
||||
"""
|
||||
|
||||
output = """
|
||||
"""
|
||||
with self.assertRaises(SyntaxError):
|
||||
self.run_cases_test(input, output)
|
||||
|
||||
def test_array_size_inconsistency(self):
|
||||
|
||||
input = """
|
||||
op(FIRST, ( -- a[2])) {
|
||||
a[0] = 1;
|
||||
}
|
||||
|
||||
op(SECOND, (a[1] -- b)) {
|
||||
b = 1;
|
||||
}
|
||||
|
||||
macro(TEST) = FIRST + SECOND;
|
||||
"""
|
||||
|
||||
output = """
|
||||
"""
|
||||
with self.assertRaises(SyntaxError):
|
||||
self.run_cases_test(input, output)
|
||||
|
||||
|
||||
class TestGeneratedAbstractCases(unittest.TestCase):
|
||||
def setUp(self) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue