bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/4] tests: fix an assertion


From: Akim Demaille
Subject: [PATCH 2/4] tests: fix an assertion
Date: Fri, 27 Jul 2012 17:12:58 +0200

* tests/local.at (AT_YYLEX_DEFINE): Be sure to check the array
against its length, not its size in bytes.
---
 tests/local.at | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/local.at b/tests/local.at
index 2dbbfc7..5c9b865 100644
--- a/tests/local.at
+++ b/tests/local.at
@@ -333,7 +333,7 @@ static
   static size_t toknum = 0;
   int res;
   ]AT_USE_LEX_ARGS[;
-  assert (toknum < sizeof input);
+  assert (toknum < sizeof input / sizeof input[0]);
   res = input[toknum++];
   ]$2[;]AT_LOCATION_IF([[
   ]AT_LOC_FIRST_LINE[ = ]AT_LOC_LAST_LINE[ = 1;
-- 
1.7.11.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]