From 75439c2489fa77c6b43e40898f803bcdd2dac352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E9=87=91=E6=88=90?= Date: Tue, 7 Jan 2025 19:11:15 +0800 Subject: [PATCH] Fix a HWAsan test case fix test case: decorate-proc-map.c This test case originally returned (int)(size_t)res, while res is a pointer returned by malloc(100). Essentially, this return value is irrelevant to what this case means to test. There was a risk that res exceeds the signed int range, which is an undefined behavior. So the result of running this executable is random. As the return value of each test case's main function is judged as a criteria for whether it passes or fails, this test case's result is random. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue: https://gitee.com/openharmony/third_party_llvm-project/issues/IB0NX9 Signed-off-by: 胡金成 Change-Id: I88789c26c03e4c78e9b3cd1dbe1e6785c42b131e --- compiler-rt/test/hwasan/TestCases/Linux/decorate-proc-maps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler-rt/test/hwasan/TestCases/Linux/decorate-proc-maps.c b/compiler-rt/test/hwasan/TestCases/Linux/decorate-proc-maps.c index 5a9208809477..011bc96818a8 100644 --- a/compiler-rt/test/hwasan/TestCases/Linux/decorate-proc-maps.c +++ b/compiler-rt/test/hwasan/TestCases/Linux/decorate-proc-maps.c @@ -51,5 +51,5 @@ int main(void) { void * volatile res2 = malloc(100000); pthread_create(&t, 0, ThreadFn, 0); pthread_join(t, 0); - return (int)(size_t)res; + return 0; // OHOS_LOCAL } -- Gitee