GNU bug report logs - #44724
Uninitialised variables in syntax.c cause trouble.

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Wed, 18 Nov 2020 17:39:01 UTC

Severity: normal

Tags: notabug

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: bug-gnu-emacs <at> gnu.org
Subject: Uninitialised variables in syntax.c cause trouble.
Date: Wed, 18 Nov 2020 17:38:34 +0000
Hello, Emacs.

On the master branch.

In src/syntax.c, there are several uninitialised static variables, one of
which is find_start_value.

It is used in function find_defun_start before being initialised.  The
first use is at L.14 of the function, this:

      && pos >= find_start_value

.  This has the effect of causing a certain (forward-comment -1) (which
calls back_comment, which calls find_defun_start) to fail.

In my test setup (I am writing tests for syntax.c), find_start_value's
value at loading time was randomly 1270, which was spuriously inside the
comment I was trying to scan backwards over.  back_comment thus failed to
recognise the comment, and returned failed.

All these variables need initialising to something if the code in
syntax.c is to work properly.

-- 
Alan Mackenzie (Nuremberg, Germany).




This bug report was last modified 4 years and 175 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.