Skip to content

Commit 2d97622

Browse files
committed
[GR-46667] fix oversight in PythonMapScope when inlining
1 parent d993fae commit 2d97622

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

graalpython/com.oracle.graal.python.test/src/com/oracle/graal/python/test/interop/JavaInteropTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,11 @@ public void builtinFunctionsAreImporteable() throws UnsupportedEncodingException
257257
assertEquals("Hello World\n", out.toString("UTF-8"));
258258
}
259259

260+
@Test
261+
public void enumeratingMainBindingsWorks() throws Exception {
262+
assertTrue(context.getBindings("python").getMemberKeys().contains("__builtins__"));
263+
}
264+
260265
@Test
261266
public void testMultipleInvocationsAreInSameScope() throws UnsupportedEncodingException {
262267
String source = "def foo(a, b):\n" +

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/interop/PythonMapScope.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Object getMembers(@SuppressWarnings("unused") boolean includeInternal,
121121
@Shared("interop") @CachedLibrary(limit = "LIMIT") InteropLibrary interop,
122122
@Shared("lenghtProfile") @Cached InlinedIntValueProfile lengthProfile)
123123
throws UnsupportedMessageException {
124-
int length = lengthProfile.profile(null, names.length);
124+
int length = lengthProfile.profile(inliningTarget, names.length);
125125
Object[] keys = new Object[length - scopeIndex];
126126
for (int i = scopeIndex; i < length; i++) {
127127
keys[i - scopeIndex] = interop.getMembers(objects[i]);

0 commit comments

Comments
 (0)