Skip to content

Commit 3d4fe51

Browse files
committed
Improve error reporting when fast-path cannot be added
1 parent 7e399e5 commit 3d4fe51

File tree

1 file changed

+5
-0
lines changed
  • com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base

1 file changed

+5
-0
lines changed

com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/BasePackage.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@
165165
import com.oracle.truffle.r.nodes.unary.UnaryArithmeticSpecial;
166166
import com.oracle.truffle.r.nodes.unary.UnaryNotNode;
167167
import com.oracle.truffle.r.nodes.unary.UnaryNotNodeGen;
168+
import com.oracle.truffle.r.runtime.RInternalError;
168169
import com.oracle.truffle.r.runtime.RVisibility;
169170
import com.oracle.truffle.r.runtime.builtins.FastPathFactory;
170171
import com.oracle.truffle.r.runtime.builtins.RBuiltin;
@@ -854,6 +855,10 @@ private void addBinaryCompare(Class<?> builtinClass, BooleanOperationFactory fac
854855

855856
private static void addFastPath(MaterializedFrame baseFrame, String name, FastPathFactory factory) {
856857
RFunction function = ReadVariableNode.lookupFunction(name, baseFrame);
858+
if (function == null) {
859+
throw new RInternalError("failed adding the fast path for the R function " + name +
860+
". The function was not found. This could be due to previous errors that prevented it from being loaded.");
861+
}
857862
((RRootNode) function.getRootNode()).setFastPath(factory);
858863
}
859864

0 commit comments

Comments
 (0)