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

[GR-2694] Check for null parameters in PrepareArguments to fix test failure.

parents 9fe2ff68 27d818bb
No related branches found
No related tags found
No related merge requests found
/* /*
* Copyright (c) 2016, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -44,6 +44,7 @@ import com.oracle.truffle.r.runtime.Arguments; ...@@ -44,6 +44,7 @@ import com.oracle.truffle.r.runtime.Arguments;
import com.oracle.truffle.r.runtime.ArgumentsSignature; import com.oracle.truffle.r.runtime.ArgumentsSignature;
import com.oracle.truffle.r.runtime.RArguments.S3DefaultArguments; import com.oracle.truffle.r.runtime.RArguments.S3DefaultArguments;
import com.oracle.truffle.r.runtime.RError; import com.oracle.truffle.r.runtime.RError;
import com.oracle.truffle.r.runtime.RInternalError;
import com.oracle.truffle.r.runtime.data.RArgsValuesAndNames; import com.oracle.truffle.r.runtime.data.RArgsValuesAndNames;
import com.oracle.truffle.r.runtime.nodes.RNode; import com.oracle.truffle.r.runtime.nodes.RNode;
...@@ -92,7 +93,13 @@ public abstract class PrepareArguments extends Node { ...@@ -92,7 +93,13 @@ public abstract class PrepareArguments extends Node {
private static RArgsValuesAndNames executeArgs(RNode[] arguments, ArgumentsSignature suppliedSignature, VirtualFrame frame) { private static RArgsValuesAndNames executeArgs(RNode[] arguments, ArgumentsSignature suppliedSignature, VirtualFrame frame) {
Object[] result = new Object[arguments.length]; Object[] result = new Object[arguments.length];
for (int i = 0; i < arguments.length; i++) { for (int i = 0; i < arguments.length; i++) {
result[i] = arguments[i].execute(frame); Object value = arguments[i].execute(frame);
if (CompilerDirectives.inInterpreter()) {
if (value == null) {
throw RInternalError.shouldNotReachHere("Java 'null' not allowed in arguments");
}
}
result[i] = value;
} }
return new RArgsValuesAndNames(result, suppliedSignature); return new RArgsValuesAndNames(result, suppliedSignature);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment