Skip to content

Commit 1090ee0

Browse files
committed
test va_list with bounds safety
1 parent 6ddef8d commit 1090ee0

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

test/Interop/C/bounds-safety/Inputs/bounds-attributed-function.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22

33
#include <ptrcheck.h>
4+
#include <stdarg.h>
45

56
#ifndef __unsafe_late_const
67
#define __unsafe_late_const
@@ -42,4 +43,6 @@ const int len1 = 7;
4243
int * __counted_by(len1) u(int * __counted_by(len1) p);
4344

4445
int len2 __unsafe_late_const;
45-
int * __counted_by(len2) v(int * __counted_by(len2) p);
46+
int * __counted_by(len2) v(int * __counted_by(len2) p);
47+
48+
void w(va_list p);

test/Interop/C/bounds-safety/import-bounds-attributed-function.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ func call(_ mutIntPtr: UnsafeMutablePointer<CInt>,
4343
_ constCharPtr: UnsafePointer<CChar>,
4444
_ mutMutIntPtrPtr: UnsafeMutablePointer<UnsafeMutablePointer<CInt>?>!,
4545
_ mutMutCharPtrPtr: UnsafeMutablePointer<UnsafeMutablePointer<CChar>?>!,
46-
_ int: CInt) {
46+
_ int: CInt,
47+
_ args: CVaListPointer) {
4748
let _ = a(mutIntPtr, int)
4849
let _ = b(mutCharPtr, int)
4950
let _ = c(mutCharPtr, int)
@@ -76,4 +77,6 @@ func call(_ mutIntPtr: UnsafeMutablePointer<CInt>,
7677
let _ = len2
7778
len2 = 37
7879
let _ = v(mutIntPtr)
80+
81+
let _ = w(args)
7982
}

0 commit comments

Comments
 (0)