Skip to content

Commit abe7097

Browse files
committed
[GR-48942] Sulong va_list aarch64 fixes
PullRequest: graal/16039
2 parents bf9b710 + 4fbe6cd commit abe7097

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

sulong/projects/com.oracle.truffle.llvm.runtime/src/com/oracle/truffle/llvm/runtime/nodes/intrinsics/llvm/aarch64/darwin/LLVMDarwinAarch64VaListStorage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, Oracle and/or its affiliates.
2+
* Copyright (c) 2022, 2023, Oracle and/or its affiliates.
33
*
44
* All rights reserved.
55
*
@@ -266,7 +266,7 @@ void toNative(@Cached LLVMI64OffsetStoreNode i64RegSaveAreaStore,
266266

267267
/* Reconstruct the native memory according to darwin-aarch64 ABI. */
268268
final int vaLength = realArguments.length - numberOfExplicitArguments;
269-
assert vaLength > 0;
269+
assert vaLength >= 0 : vaLength;
270270

271271
long offset = 0;
272272
for (int i = numberOfExplicitArguments; i < realArguments.length; i++) {

sulong/projects/com.oracle.truffle.llvm.runtime/src/com/oracle/truffle/llvm/runtime/nodes/intrinsics/llvm/aarch64/linux/LLVMLinuxAarch64VaListStorage.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public boolean canCopyFrom(Object source, @SuppressWarnings("unused") long lengt
166166
@ExportMessage
167167
public void copyFrom(Object source, @SuppressWarnings("unused") long length,
168168
@Cached VAListPointerWrapperFactoryDelegate wrapperFactory,
169-
@CachedLibrary(limit = "1") LLVMVaListLibrary vaListLibrary,
169+
@CachedLibrary(limit = "2") LLVMVaListLibrary vaListLibrary,
170170
@Cached BranchProfile invalidLengthProfile) {
171171
if (length != Aarch64BitVarArgs.SIZE_OF_VALIST) {
172172
invalidLengthProfile.enter();
@@ -729,7 +729,7 @@ static void copyNativeToManaged(LLVMLinuxAarch64VaListStorage source, LLVMLinuxA
729729
@GenerateAOT.Exclude // recursion cut
730730
static void copyNative(LLVMLinuxAarch64VaListStorage source, LLVMLinuxAarch64VaListStorage dest, Frame frame,
731731
@Cached VAListPointerWrapperFactoryDelegate wrapperFactory,
732-
@CachedLibrary(limit = "1") LLVMVaListLibrary vaListLibrary) {
732+
@CachedLibrary(limit = "2") LLVMVaListLibrary vaListLibrary) {
733733
// The source valist is just a holder of the native counterpart and thus the destination
734734
// will not be set up as a managed va_list as it would be too complicated to restore the
735735
// managed state from the native one.
@@ -739,7 +739,7 @@ static void copyNative(LLVMLinuxAarch64VaListStorage source, LLVMLinuxAarch64VaL
739739
@Specialization
740740
@GenerateAOT.Exclude // recursion cut
741741
static void copyManagedToNative(LLVMLinuxAarch64VaListStorage source, NativeVAListWrapper dest, Frame frame,
742-
@CachedLibrary(limit = "1") LLVMVaListLibrary vaListLibrary) {
742+
@CachedLibrary(limit = "2") LLVMVaListLibrary vaListLibrary) {
743743
LLVMLinuxAarch64VaListStorage dummyClone = new LLVMLinuxAarch64VaListStorage(dest.nativeVAListPtr, source.vaListType);
744744
dummyClone.nativized = true;
745745
vaListLibrary.initialize(dummyClone, source.realArguments, source.numberOfExplicitArguments, frame);

0 commit comments

Comments
 (0)