Skip to content

Commit 57ced80

Browse files
committed
Avoid NPE on null frame in frame builtins
1 parent 630fa04 commit 57ced80

File tree

1 file changed

+3
-3
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/frame

1 file changed

+3
-3
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/frame/FrameBuiltins.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
import com.oracle.graal.python.builtins.objects.function.PArguments;
4141
import com.oracle.graal.python.builtins.objects.module.PythonModule;
4242
import com.oracle.graal.python.builtins.objects.object.ObjectBuiltins.DictNode;
43-
import com.oracle.graal.python.builtins.objects.object.ObjectBuiltinsFactory.DictNodeFactory;
4443
import com.oracle.graal.python.builtins.objects.object.PythonObject;
44+
import com.oracle.graal.python.builtins.objects.object.ObjectBuiltinsFactory.DictNodeFactory;
4545
import com.oracle.graal.python.nodes.PRootNode;
4646
import com.oracle.graal.python.nodes.argument.ReadArgumentNode;
4747
import com.oracle.graal.python.nodes.frame.MaterializeFrameNode;
@@ -136,7 +136,7 @@ int get(VirtualFrame frame, PFrame self,
136136
// we need to sync the location of the frame if and only if 'self' represents the
137137
// current frame. If 'self' represents another frame on the stack, the location is
138138
// already set
139-
if (isCurrentFrameProfile.profile(PArguments.getCurrentFrameInfo(frame) == self.getRef())) {
139+
if (isCurrentFrameProfile.profile(frame != null && PArguments.getCurrentFrameInfo(frame) == self.getRef())) {
140140
PFrame pyFrame = materializeNode.execute(frame, this, false, false);
141141
assert pyFrame == self;
142142
}
@@ -205,7 +205,7 @@ Object getUpdating(VirtualFrame frame, PFrame self,
205205
// we need to sync the values of the frame if and only if 'self' represents the current
206206
// frame. If 'self' represents another frame on the stack, the values are already
207207
// refreshed.
208-
if (profile.profile(PArguments.getCurrentFrameInfo(frame) == self.getRef())) {
208+
if (profile.profile(frame != null && PArguments.getCurrentFrameInfo(frame) == self.getRef())) {
209209
PFrame pyFrame = materializeNode.execute(frame, false, true, frame);
210210
assert pyFrame == self;
211211
}

0 commit comments

Comments
 (0)