Skip to content

Commit 14b6ab3

Browse files
author
Adam Hrbac
committed
Avoid calling .fromFlags outside @TruffleBoundary
1 parent 9f057ab commit 14b6ab3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/PythonLanguage.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,12 @@ public RootCallTarget parse(PythonContext context, Source source, InputType type
541541
}
542542
}
543543

544+
@TruffleBoundary
545+
public RootCallTarget compileForBytecodeInterpreter(PythonContext context, ModTy mod, Source source, boolean topLevel, int optimize, List<String> argumentNames,
546+
RaisePythonExceptionErrorCallback errorCallback, int flags) {
547+
return compileForBytecodeInterpreter(context, mod, source, topLevel, optimize, argumentNames, errorCallback, FutureFeature.fromFlags(flags));
548+
}
549+
544550
@TruffleBoundary
545551
public RootCallTarget compileForBytecodeInterpreter(PythonContext context, ModTy mod, Source source, boolean topLevel, int optimize, List<String> argumentNames,
546552
RaisePythonExceptionErrorCallback errorCallback, EnumSet<FutureFeature> futureFeatures) {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/BuiltinFunctions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ Object generic(VirtualFrame frame, Object wSource, Object wFilename, TruffleStri
11911191
if (AstModuleBuiltins.isAst(getContext(), wSource)) {
11921192
ModTy mod = AstModuleBuiltins.obj2sst(getContext(), wSource, getParserInputType(mode, flags));
11931193
Source source = PythonUtils.createFakeSource(filename);
1194-
RootCallTarget rootCallTarget = getLanguage().compileForBytecodeInterpreter(getContext(), mod, source, false, optimize, null, null, FutureFeature.fromFlags(flags));
1194+
RootCallTarget rootCallTarget = getLanguage().compileForBytecodeInterpreter(getContext(), mod, source, false, optimize, null, null, flags);
11951195
return wrapRootCallTarget(rootCallTarget);
11961196
}
11971197
TruffleString source = sourceAsString(frame, wSource, filename, interopLib, acquireLib, bufferLib, handleDecodingErrorNode, asStrNode, switchEncodingNode);

0 commit comments

Comments
 (0)