aboutsummaryrefslogtreecommitdiff
path: root/gdb/guile
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@adacore.com>2015-01-06 18:37:53 +0400
committerJoel Brobecker <brobecker@adacore.com>2015-01-06 19:09:54 +0400
commitfce10a8494efa8faec67b718f25e06d3d71694b3 (patch)
treee7240e5e692dbb18a13cff70c7307ab9599d01ce /gdb/guile
parent8503d6e1e564cb5ac61bc6e3f16c0b384c76661e (diff)
downloadgdb-fce10a8494efa8faec67b718f25e06d3d71694b3.zip
gdb-fce10a8494efa8faec67b718f25e06d3d71694b3.tar.gz
gdb-fce10a8494efa8faec67b718f25e06d3d71694b3.tar.bz2
gdb/guile: Do not error when trying to create empty array.
This fixes a similar error as in the Python support code where trying to create an empty array. In guile/scm-type.c::tyscm_array_1, the funtion raises an exception if N2 < N1: if (n2 < n1) { gdbscm_out_of_range_error (func_name, SCM_ARG3, But it should be doing so if N2 == N1 - 1, since that would simply be an empty array, not an array with a negative length. gdb/ChangeLog: * guile/scm-type.c (tyscm_array_1): Do not raise out-of-range error if N2 is equal to N1 - 1.
Diffstat (limited to 'gdb/guile')
-rw-r--r--gdb/guile/scm-type.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/guile/scm-type.c b/gdb/guile/scm-type.c
index 92d5328..4f46139 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)
+ if (n2 < n1 - 1)
{
gdbscm_out_of_range_error (func_name, SCM_ARG3,
scm_cons (scm_from_long (n1),