Skip to content
Snippets Groups Projects
Commit ed5129f9 authored by Florian Angerer's avatar Florian Angerer
Browse files

Fix race when concurrently initializing builtins.

parent 4b0f1066
No related branches found
No related tags found
No related merge requests found
......@@ -95,6 +95,11 @@ public final class RBuiltinRootNode extends RRootNode {
initialize();
Object[] arguments = new Object[args.length];
for (int i = 0; i < args.length; i++) {
if (args[i] == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
args[i] = insert(AccessArgumentNode.create(i));
args[i].setFormals(call.getFormals());
}
arguments[i] = args[i].execute(frame);
}
return call.execute(frame, null, new RArgsValuesAndNames(arguments, factory.getSignature()), null);
......@@ -117,10 +122,6 @@ public final class RBuiltinRootNode extends RRootNode {
assert factory.getSignature().getVarArgCount() == 0 || factory.getSignature().getVarArgIndex() == factory.getSignature().getLength() - 1 : "only last argument can be vararg";
}
call = insert(new BuiltinCallNode(builtin, factory, formalArguments, null, true));
for (int i = 0; i < args.length; i++) {
args[i] = insert(AccessArgumentNode.create(i));
args[i].setFormals(formalArguments);
}
}
}
......
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