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:
Mark Shannon 2024-09-12 15:32:45 +01:00 committed by GitHub
parent 3ea51fa2e3
commit 4ed7d1d6ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 344 additions and 327 deletions

View file

@ -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: