llvm-c-test avoid calling malloc(0)
authorAndus Yu <andusyllvm@gmail.com>
Thu, 4 Jul 2019 14:36:34 +0000 (14:36 +0000)
committerAndus Yu <andusyllvm@gmail.com>
Thu, 4 Jul 2019 14:36:34 +0000 (14:36 +0000)
commit7aff852810d363378009fec3486486931e43c034
treea9212244d432db7532b510d1e9850d888c24ea04
parent0810f16fb9e89e9d7809a0e9a9a7296b35f8ef27
llvm-c-test avoid calling malloc(0)

Summary:
As explained in D63668, malloc(0) could return a null pointer. llvm-c-test does not handle this case correctly. Instead of calling malloc(0), avoid the operation altogether.

Authored By: andusy

Reviewers: hubert.reinterpretcast, xingxue, jasonliu, daltenty, cebowleratibm

Reviewed By: hubert.reinterpretcast

Subscribers: mehdi_amini, dexonsmith, jsji, llvm-commits

Tags: LLVM

Differential Revision: https://reviews.llvm.org/D63788

llvm-svn: 365144
llvm/tools/llvm-c-test/attributes.c