Skip to content

Commit 332c3da

Browse files
committed
Fix missing @child annotation on a node field
1 parent f0d4ebe commit 332c3da

File tree

1 file changed

+5
-13
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/posix

1 file changed

+5
-13
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/posix/DirEntryBuiltins.java

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -81,7 +81,6 @@
8181
import com.oracle.graal.python.runtime.PosixSupportLibrary;
8282
import com.oracle.graal.python.runtime.PosixSupportLibrary.PosixException;
8383
import com.oracle.graal.python.runtime.object.PythonObjectFactory;
84-
import com.oracle.truffle.api.CompilerDirectives;
8584
import com.oracle.truffle.api.dsl.Bind;
8685
import com.oracle.truffle.api.dsl.Cached;
8786
import com.oracle.truffle.api.dsl.Cached.Shared;
@@ -315,7 +314,6 @@ abstract static class TestModeNode extends Node {
315314

316315
private final long expectedMode;
317316
private final int expectedDirEntryType;
318-
private StatHelperNode statHelperNode;
319317

320318
protected TestModeNode(long expectedMode, int expectedDirEntryType) {
321319
this.expectedMode = expectedMode;
@@ -327,8 +325,9 @@ protected TestModeNode(long expectedMode, int expectedDirEntryType) {
327325
@Specialization(guards = "followSymlinks")
328326
boolean testModeUsingStat(VirtualFrame frame, PDirEntry self, boolean followSymlinks,
329327
@Bind("this") Node inliningTarget,
328+
@Shared @Cached StatHelperNode statHelperNode,
330329
@Shared @Cached SequenceStorageNodes.GetItemScalarNode getItemScalarNode) {
331-
PTuple statResult = getStatHelperNode().execute(frame, self, followSymlinks, true);
330+
PTuple statResult = statHelperNode.execute(frame, self, followSymlinks, true);
332331
if (statResult == null) {
333332
// file not found
334333
return false;
@@ -341,21 +340,14 @@ boolean testModeUsingStat(VirtualFrame frame, PDirEntry self, boolean followSyml
341340
@Specialization(guards = "!followSymlinks")
342341
boolean useTypeIfKnown(VirtualFrame frame, PDirEntry self, @SuppressWarnings("unused") boolean followSymlinks,
343342
@Bind("this") Node inliningTarget,
343+
@Shared @Cached StatHelperNode statHelperNode,
344344
@Shared @Cached SequenceStorageNodes.GetItemScalarNode getItemScalarNode,
345345
@CachedLibrary(limit = "1") PosixSupportLibrary posixLib) {
346346
int entryType = posixLib.dirEntryGetType(PosixSupport.get(this), self.dirEntryData);
347347
if (entryType != DT_UNKNOWN.value) {
348348
return entryType == expectedDirEntryType;
349349
}
350-
return testModeUsingStat(frame, self, false, inliningTarget, getItemScalarNode);
351-
}
352-
353-
private StatHelperNode getStatHelperNode() {
354-
if (statHelperNode == null) {
355-
CompilerDirectives.transferToInterpreterAndInvalidate();
356-
statHelperNode = insert(DirEntryBuiltinsFactory.StatHelperNodeGen.create());
357-
}
358-
return statHelperNode;
350+
return testModeUsingStat(frame, self, false, inliningTarget, statHelperNode, getItemScalarNode);
359351
}
360352

361353
@NeverDefault

0 commit comments

Comments
 (0)