1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

maybe_annotate_source does not annotate negative positions

* libguile/read.c (maybe_annotate_source): Don't annotate with negative
  lines or columns.
This commit is contained in:
Andy Wingo 2014-07-21 21:37:20 +02:00
parent 3c01acbcf5
commit 3ddd438179

View file

@ -411,6 +411,11 @@ static SCM
maybe_annotate_source (SCM x, SCM port, scm_t_read_opts *opts, maybe_annotate_source (SCM x, SCM port, scm_t_read_opts *opts,
long line, int column) 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) if (opts->record_positions_p)
scm_i_set_source_properties_x (x, line, column, SCM_FILENAME (port)); scm_i_set_source_properties_x (x, line, column, SCM_FILENAME (port));
return x; return x;