Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4ed7d1d

Browse filesBrowse files
authored
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)
1 parent 3ea51fa commit 4ed7d1d
Copy full SHA for 4ed7d1d

File tree

7 files changed

+344
-327
lines changed
Filter options

7 files changed

+344
-327
lines changed

‎Lib/test/test_generated_cases.py

Copy file name to clipboardExpand all lines: Lib/test/test_generated_cases.py
+38Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,6 +1110,44 @@ def test_push_then_error(self):
11101110
"""
11111111
self.run_cases_test(input, output)
11121112

1113+
def test_scalar_array_inconsistency(self):
1114+
1115+
input = """
1116+
op(FIRST, ( -- a)) {
1117+
a = 1;
1118+
}
1119+
1120+
op(SECOND, (a[1] -- b)) {
1121+
b = 1;
1122+
}
1123+
1124+
macro(TEST) = FIRST + SECOND;
1125+
"""
1126+
1127+
output = """
1128+
"""
1129+
with self.assertRaises(SyntaxError):
1130+
self.run_cases_test(input, output)
1131+
1132+
def test_array_size_inconsistency(self):
1133+
1134+
input = """
1135+
op(FIRST, ( -- a[2])) {
1136+
a[0] = 1;
1137+
}
1138+
1139+
op(SECOND, (a[1] -- b)) {
1140+
b = 1;
1141+
}
1142+
1143+
macro(TEST) = FIRST + SECOND;
1144+
"""
1145+
1146+
output = """
1147+
"""
1148+
with self.assertRaises(SyntaxError):
1149+
self.run_cases_test(input, output)
1150+
11131151

11141152
class TestGeneratedAbstractCases(unittest.TestCase):
11151153
def setUp(self) -> None:

‎Python/bytecodes.c

Copy file name to clipboardExpand all lines: Python/bytecodes.c
+67-76Lines changed: 67 additions & 76 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.