Skip to content
Snippets Groups Projects
Commit 3fbec4b5 authored by Lukas Stadler's avatar Lukas Stadler
Browse files

avoid NPE in GetCallerFrameNode when Utils.getCallterFrame returns null

parent b3de3efe
Branches
No related tags found
No related merge requests found
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -48,9 +48,11 @@ public final class GetCallerFrameNode extends RBaseNode {
CompilerDirectives.transferToInterpreterAndInvalidate();
slowPathSeen = true;
}
funFrame = Utils.getCallerFrame(frame, FrameAccess.MATERIALIZE).materialize();
RError.performanceWarning("slow caller frame access in UseMethod dispatch");
if (funFrame == null) {
Frame callerFrame = Utils.getCallerFrame(frame, FrameAccess.MATERIALIZE);
if (callerFrame != null) {
return callerFrame.materialize();
} else {
topLevelProfile.enter();
// S3 method can be dispatched from top-level where there is no caller frame
return frame.materialize();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment