Skip to content
Snippets Groups Projects
Commit e9b27e01 authored by Mick Jordan's avatar Mick Jordan
Browse files

fix for match.call crash with VarArgNode

parent c2d735b7
Branches
No related tags found
No related merge requests found
......@@ -160,8 +160,14 @@ public class RASTUtils {
RLanguage l = (RLanguage) value;
return (RNode) NodeUtil.cloneNode((Node) l.getRep());
} else if (value instanceof RPromise) {
// TODO: flatten nested promises?
return NodeUtil.cloneNode(((RNode) ((RPromise) value).getRep()).unwrap());
RPromise promise = (RPromise) value;
RNode promiseRep = ((RNode) ((RPromise) value).getRep()).unwrap();
if (promiseRep instanceof VarArgNode) {
VarArgNode varArgNode = (VarArgNode) promiseRep;
RPromise varArgPromise = varArgNode.executeNonEvaluated((VirtualFrame) promise.getFrame());
return createNodeForValue(varArgPromise);
}
return NodeUtil.cloneNode(promiseRep);
} else {
return ConstantNode.create(value);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment