poke-devel
[Top][All Lists]
Advanced

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

[PATCH] Allow arrays of size zero


From: John Darrington
Subject: [PATCH] Allow arrays of size zero
Date: Sun, 17 Nov 2019 13:31:25 +0100

        * src/pkl-typify.c (PKL_PHRASE_BEGIN_HANDLER): Change bound to accept 
zero sized arrays.
        Also, adjust the error message and correct the spelling.
---
 src/pkl-typify.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/pkl-typify.c b/src/pkl-typify.c
index 86dc651..e28af80 100644
--- a/src/pkl-typify.c
+++ b/src/pkl-typify.c
@@ -2218,10 +2218,10 @@ PKL_PHASE_BEGIN_HANDLER (pkl_typify2_ps_type_array)
 
       if (PKL_AST_TYPE_CODE (bound_type) == PKL_TYPE_INTEGRAL
           && PKL_AST_CODE (bound) == PKL_AST_INTEGER
-          && ((int64_t) PKL_AST_INTEGER_VALUE (bound)) <= 0)
+          && ((int64_t) PKL_AST_INTEGER_VALUE (bound)) < 0)
         {
           PKL_ERROR (PKL_AST_LOC (bound),
-                     "array dimentions should be > 0");
+                     "array dimensions may not be negative");
           PKL_TYPIFY_PAYLOAD->errors++;
           PKL_PASS_ERROR;
         }
-- 
2.11.0




reply via email to

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