File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1785,11 +1785,17 @@ public Object globals(VirtualFrame frame) {
17851785 abstract static class LocalsNode extends PythonBuiltinNode {
17861786 @ Child ReadCallerFrameNode readCallerFrameNode = ReadCallerFrameNode .create ();
17871787 @ Child GetLocalsNode getLocalsNode = GetLocalsNode .create ();
1788+ private final ConditionProfile inGenerator = ConditionProfile .createBinaryProfile ();
17881789
17891790 @ Specialization
17901791 public Object locals (VirtualFrame frame ) {
17911792 Frame callerFrame = readCallerFrameNode .executeWith (frame );
1792- return getLocalsNode .execute (callerFrame );
1793+ Frame generatorFrame = PArguments .getGeneratorFrame (callerFrame );
1794+ if (inGenerator .profile (generatorFrame == null )) {
1795+ return getLocalsNode .execute (callerFrame );
1796+ } else {
1797+ return getLocalsNode .execute (generatorFrame );
1798+ }
17931799 }
17941800 }
17951801}
You can’t perform that action at this time.
0 commit comments