From: Mike Stump Date: Tue, 12 Jan 2010 00:28:59 +0000 (+0000) Subject: Allow N_FIELDS to be 0. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66d29ec664e3fabcaa65cb7f459897508bc59872;p=clang Allow N_FIELDS to be 0. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93211 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/VtableTest/gen.cc b/utils/VtableTest/gen.cc index 0f586e5918..5bcfff06ba 100644 --- a/utils/VtableTest/gen.cc +++ b/utils/VtableTest/gen.cc @@ -110,7 +110,7 @@ void gs(int s) { gl(" {"); /* Fields */ - int n_fields = random() % (N_FIELDS*4); + int n_fields = N_FIELDS == 0 ? 0 : random() % (N_FIELDS*4); // PARAM: 3/4 of all structs should have no members if (n_fields >= N_FIELDS) n_fields = 0;