Skip to content
Snippets Groups Projects
Commit 34d4bf83 authored by Julien Lopez's avatar Julien Lopez
Browse files

Fix R in databases for functions

parent c83c2f99
No related branches found
No related tags found
No related merge requests found
......@@ -267,7 +267,13 @@ public final class TruffleRLanguageImpl extends TruffleRLanguage {
final org.graalvm.polyglot.Source source = org.graalvm.polyglot.Source.newBuilder("R", program, "mySrc").build();
final Value result = rContext.eval(source);
final Object rValue = QIRInterface.getRValueFromTruffle(result);
final RValue res = rValue instanceof Serializable ? new RValue((Serializable) rValue) : (RValue) rValue;
final RValue res;
if (rValue instanceof Serializable)
res = new RValue((Serializable) rValue);
else if (rValue instanceof RValue)
res = (RValue) rValue;
else
res = new RValue(result.getSourceLocation().getCharacters().toString());
valueCache.put(program, res);
return res;
} catch (Exception e) {
......
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