GNU bug report logs - #75521
scratch/igc: Delete unused macro DEFVAR_LISP_NOPROX

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefankangas <at> gmail.com>

Date: Sun, 12 Jan 2025 17:56:02 UTC

Severity: wishlist

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pip Cet <pipcet <at> protonmail.com>
Cc: 75521 <at> debbugs.gnu.org, stefankangas <at> gmail.com
Subject: Re: bug#75521: scratch/igc: Delete unused macro DEFVAR_LISP_NOPROX
Date: Mon, 13 Jan 2025 19:16:21 +0200
> Date: Mon, 13 Jan 2025 16:46:39 +0000
> From: Pip Cet <pipcet <at> protonmail.com>
> Cc: 75521 <at> debbugs.gnu.org, stefankangas <at> gmail.com
> 
> "Eli Zaretskii" <eliz <at> gnu.org> writes:
> 
> >> Date: Mon, 13 Jan 2025 14:16:04 +0000
> >> From: Pip Cet <pipcet <at> protonmail.com>
> >> Cc: 75521 <at> debbugs.gnu.org, stefankangas <at> gmail.com
> >>
> >> "Eli Zaretskii" <eliz <at> gnu.org> writes:
> >>
> >> >> But then font_style_table is sometimes modified so it points to
> >> >> (i.e. contains as its element) a new vector, and I don't see how
> >> >> Vfont_weight_table is protected then.
> >> >
> >> > Modified where?
> >>
> >> font_style_to_value:
> >>
> >>       if (! noerror)
> >> 	return -1;
> >>       eassert (len < 255);
> >>       elt = make_vector (2, make_fixnum (100));
> >>       ASET (elt, 1, val);
> >>       ASET (font_style_table, prop - FONT_WEIGHT_INDEX,
> >> 	    CALLN (Fvconcat, table, make_vector (1, elt)));
> >>       return (100 << 8) | (i << 4);
> >
> > OK, but the values gets plugged int font_style_table, right?  And my
> > reading of mark_object_root_visitor is that it marks its argument
> > recursively, so any object reachable from font_style_table should also
> > be protected?  Am I wrong?
> 
> No, you're not.  Initially, Vfont_weight_table is protected because it's
> reached recursively from font_style_table.  If font_style_table is
> modified no longer to contain Vfont_weight_table (by the code above),
> Vfont_weight_table loses its protection.  Accessing Vfont_weight_table
> from Lisp when it's no longer protected will eventually cause a crash.

But the above code just uses ASET to put in one of font_style_table's
slots a Lisp vector.  That vector is therefore reachable from
font_style_table (which is also a Lisp vector).  No?




This bug report was last modified 122 days ago.

Previous Next


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