Skip to content

Commit d53f7aa

Browse files
committed
[GR-33739] Fix SOE in FinalizerThread.
PullRequest: graal/9788
2 parents 00abb19 + 22df67e commit d53f7aa

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/Target_java_lang_ref_Reference.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,20 +198,16 @@ static void reachabilityFence(Object ref) {
198198
GraalDirectives.blackhole(ref);
199199
}
200200

201-
@Substitute //
201+
@KeepOriginal
202202
@TargetElement(onlyWith = JDK16OrLater.class) //
203-
T getFromInactiveFinalReference() {
204-
// assert this instanceof FinalReference;
205-
assert next != null; // I.e. FinalReference is inactive
206-
return get();
207-
}
203+
native T getFromInactiveFinalReference();
208204

209205
@Substitute //
210206
@TargetElement(onlyWith = JDK16OrLater.class) //
211207
void clearInactiveFinalReference() {
212208
// assert this instanceof FinalReference;
213209
assert next != null; // I.e. FinalReference is inactive
214-
clear();
210+
ReferenceInternals.clear(SubstrateUtil.cast(this, Reference.class));
215211
}
216212
}
217213

0 commit comments

Comments
 (0)