diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2018-07-11 22:19:14 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2018-07-11 22:19:14 +0000 |
commit | e18c2d2ce3b967b0bd495d2840cb640b95c80896 (patch) | |
tree | 87909f571e908c8b715cc902a2b26e8fc19ce611 /clang/test/CodeGen/builtins.c | |
parent | ef08aec9352a4827a2f9c83fffd7844155b1a633 (diff) | |
download | bcm5719-llvm-e18c2d2ce3b967b0bd495d2840cb640b95c80896.tar.gz bcm5719-llvm-e18c2d2ce3b967b0bd495d2840cb640b95c80896.zip |
os_log: When there are multiple privacy annotations in the format
string, choose the strictest one instead of the last.
Also fix an undefined behavior. Move the pointer update to a later point to
avoid adding StringRef::npos to the pointer.
rdar://problem/40706280
llvm-svn: 336863
Diffstat (limited to 'clang/test/CodeGen/builtins.c')
-rw-r--r-- | clang/test/CodeGen/builtins.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/CodeGen/builtins.c b/clang/test/CodeGen/builtins.c index 4059f16fbfd..77b479e4c11 100644 --- a/clang/test/CodeGen/builtins.c +++ b/clang/test/CodeGen/builtins.c @@ -421,7 +421,7 @@ void test_builtin_os_log(void *buf, int i, const char *data) { // CHECK: %[[V5:.*]] = load i8*, i8** %[[DATA_ADDR]] // CHECK: %[[V6:.*]] = ptrtoint i8* %[[V5]] to i64 // CHECK: call void @__os_log_helper_1_3_4_4_0_8_34_4_17_8_49(i8* %[[V1]], i32 %[[V2]], i64 %[[V4]], i32 16, i64 %[[V6]]) - __builtin_os_log_format(buf, "%d %{private,public}s %{public,private}.16P", i, data, data); + __builtin_os_log_format(buf, "%d %{public}s %{private}.16P", i, data, data); // privacy annotations aren't recognized when they are preceded or followed // by non-whitespace characters. @@ -443,7 +443,7 @@ void test_builtin_os_log(void *buf, int i, const char *data) { // The last privacy annotation in the string wins. // CHECK: call void @__os_log_helper_1_3_1_8_33( - __builtin_os_log_format(buf, "%{ public, private, public, private}s", "abc"); + __builtin_os_log_format(buf, "%{ private, public, private, public}s", "abc"); } // CHECK-LABEL: define linkonce_odr hidden void @__os_log_helper_1_3_4_4_0_8_34_4_17_8_49 |