Skip to content

Commit

Permalink
Recompute array index shift for unsafe access in JCTools
Browse files Browse the repository at this point in the history
Fixes segmentation faults when using mutiny.
  • Loading branch information
jponge authored and zakkak committed Apr 3, 2024
1 parent d658f77 commit 12ccf6d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions extensions/mutiny/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.graalvm.sdk</groupId>
<artifactId>nativeimage</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package io.quarkus.mutiny.runtime;

import com.oracle.svm.core.annotate.Alias;
import com.oracle.svm.core.annotate.RecomputeFieldValue;
import com.oracle.svm.core.annotate.TargetClass;

class JCToolsSupport {
}

// Thanks to https://github.com/DataDog/dd-trace-java/pull/6020
@TargetClass(className = "org.jctools.util.UnsafeRefArrayAccess")
final class Target_org_jctools_util_UnsafeRefArrayAccess {

@Alias
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.ArrayIndexShift, declClass = Object[].class)
public static int REF_ELEMENT_SHIFT;
}

0 comments on commit 12ccf6d

Please sign in to comment.