summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@adacore.com>2015-01-07 07:34:29 +0400
committerJoel Brobecker <brobecker@adacore.com>2015-01-07 07:36:20 +0400
commite810d75b1c9bef779b29df9d2c609fd5891d5917 (patch)
treeee4906cee5fe1d7805d8ddfab6f61da5429399d7
parent6f25f22356dcf9ddf6b375c8e967486f10855dfd (diff)
downloadbinutils-gdb-e810d75b1c9bef779b29df9d2c609fd5891d5917.tar.gz
[python,guile] Add comment beside conditions testing empty arrays.
gdb/ChangeLog: * guile/scm-type.c (tyscm_array_1): Add comment. * python/py-type.c (typy_array_1): Add comment.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/guile/scm-type.c2
-rw-r--r--gdb/python/py-type.c2
3 files changed, 7 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8e3737dfc45..0b63d3417e3 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-07 Joel Brobecker <brobecker@adacore.com>
+
+ * guile/scm-type.c (tyscm_array_1): Add comment.
+ * python/py-type.c (typy_array_1): Add comment.
+
2015-01-06 Joel Brobecker <brobecker@adacore.com>
* guile/scm-type.c (tyscm_array_1): Do not raise out-of-range
diff --git a/gdb/guile/scm-type.c b/gdb/guile/scm-type.c
index 4f46139241f..196b4a13633 100644
--- a/gdb/guile/scm-type.c
+++ b/gdb/guile/scm-type.c
@@ -713,7 +713,7 @@ tyscm_array_1 (SCM self, SCM n1_scm, SCM n2_scm, int is_vector,
n1 = 0;
}
- if (n2 < n1 - 1)
+ if (n2 < n1 - 1) /* Note: An empty array has n2 == n1 - 1. */
{
gdbscm_out_of_range_error (func_name, SCM_ARG3,
scm_cons (scm_from_long (n1),
diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c
index 8e82c99f2e2..bf923639a88 100644
--- a/gdb/python/py-type.c
+++ b/gdb/python/py-type.c
@@ -528,7 +528,7 @@ typy_array_1 (PyObject *self, PyObject *args, int is_vector)
n1 = 0;
}
- if (n2 < n1 - 1)
+ if (n2 < n1 - 1) /* Note: An empty array has n2 == n1 - 1. */
{
PyErr_SetString (PyExc_ValueError,
_("Array length must not be negative"));