]> granicus.if.org Git - clang/commitdiff
Allow N_FIELDS to be 0.
authorMike Stump <mrs@apple.com>
Tue, 12 Jan 2010 00:28:59 +0000 (00:28 +0000)
committerMike Stump <mrs@apple.com>
Tue, 12 Jan 2010 00:28:59 +0000 (00:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93211 91177308-0d34-0410-b5e6-96231b3b80d8

utils/VtableTest/gen.cc

index 0f586e5918a3b2ae8b45757fdb285baf32b9fb1b..5bcfff06badfe0171b817ee4c008d7d48246bf52 100644 (file)
@@ -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;