Skip to content

Commit a40992f

Browse files
committed
Add fast path when access too all files is allowed
1 parent 9010522 commit a40992f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/org/truffleruby/language/loader/FileLoader.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ public Pair<Source, TStringWithEncoding> loadFile(String path) throws IOExceptio
7979

8080
public static TruffleFile getSafeTruffleFile(RubyLanguage language, RubyContext context, String path) {
8181
final Env env = context.getEnv();
82+
if (env.isFileIOAllowed()) {
83+
return env.getPublicTruffleFile(path);
84+
}
85+
8286
final TruffleFile file;
8387
try {
8488
file = env.getInternalTruffleFile(path).getCanonicalFile();

0 commit comments

Comments
 (0)