8299561: VaList.empty() doesn't return a list associated with the global scope
Reviewed-by: jvernee
This commit is contained in:
parent
a17f505d73
commit
9c4ed16be2
@ -129,7 +129,7 @@ public non-sealed class LinuxAArch64VaList implements VaList {
|
||||
}
|
||||
|
||||
private static MemorySegment emptyListAddress() {
|
||||
MemorySegment ms = MemorySegment.allocateNative(LAYOUT, SegmentScope.auto());
|
||||
MemorySegment ms = MemorySegment.allocateNative(LAYOUT, SegmentScope.global());
|
||||
VH_stack.set(ms, MemorySegment.NULL);
|
||||
VH_gr_top.set(ms, MemorySegment.NULL);
|
||||
VH_vr_top.set(ms, MemorySegment.NULL);
|
||||
|
@ -138,7 +138,7 @@ public non-sealed class SysVVaList implements VaList {
|
||||
}
|
||||
|
||||
private static MemorySegment emptyListAddress() {
|
||||
MemorySegment base = MemorySegment.allocateNative(LAYOUT, SegmentScope.auto());
|
||||
MemorySegment base = MemorySegment.allocateNative(LAYOUT, SegmentScope.global());
|
||||
VH_gp_offset.set(base, MAX_GP_OFFSET);
|
||||
VH_fp_offset.set(base, MAX_FP_OFFSET);
|
||||
VH_overflow_arg_area.set(base, MemorySegment.NULL);
|
||||
|
@ -907,4 +907,8 @@ public class VaListTest extends NativeTestHelper {
|
||||
assertThrows(NoSuchElementException.class, () -> nextVarg(vaList, next));
|
||||
}
|
||||
|
||||
@Test(dataProvider = "emptyVaLists")
|
||||
public void testEmptyVaListScope(VaList vaList) {
|
||||
assertEquals(vaList.segment().scope(), SegmentScope.global());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user