summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2014-07-21 21:37:20 +0200
committerAndy Wingo <wingo@pobox.com>2014-07-21 21:38:17 +0200
commit3ddd438179d98b0370592ea82b748de25d76c4d7 (patch)
tree6667691844766127b6bb56bdb9916d106d3efc76
parent3c01acbcf5afe0be07d44a12cf3f23106b8ca1a5 (diff)
downloadguile-3ddd438179d98b0370592ea82b748de25d76c4d7.tar.gz
maybe_annotate_source does not annotate negative positions
* libguile/read.c (maybe_annotate_source): Don't annotate with negative lines or columns.
-rw-r--r--libguile/read.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libguile/read.c b/libguile/read.c
index bcb40ee85..c2d50afdf 100644
--- a/libguile/read.c
+++ b/libguile/read.c
@@ -411,6 +411,11 @@ static SCM
maybe_annotate_source (SCM x, SCM port, scm_t_read_opts *opts,
long line, int column)
{
+ /* This condition can be caused by a user calling
+ set-port-column!. */
+ if (line < 0 || column < 0)
+ return x;
+
if (opts->record_positions_p)
scm_i_set_source_properties_x (x, line, column, SCM_FILENAME (port));
return x;