bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#21602: 25.0.50; coding system seg fault


From: Eli Zaretskii
Subject: bug#21602: 25.0.50; coding system seg fault
Date: Sat, 03 Oct 2015 15:15:51 +0300

> From: Andreas Schwab <schwab@linux-m68k.org>
> Cc: eliz@gnu.org,  rms@gnu.org
> Date: Sat, 03 Oct 2015 14:07:19 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > diff --git a/src/fileio.c b/src/fileio.c
> > index e4b255a..65aaf57 100644
> > --- a/src/fileio.c
> > +++ b/src/fileio.c
> > @@ -3470,7 +3470,10 @@ by calling `format-decode', which see.  */)
> >        mtime = time_error_value (save_errno);
> >        st.st_size = -1;
> >        if (!NILP (Vcoding_system_for_read))
> > -   Fset (Qbuffer_file_coding_system, Vcoding_system_for_read);
> > +   {
> > +     CHECK_CODING_SYSTEM (Vcoding_system_for_read);
> > +     Fset (Qbuffer_file_coding_system, Vcoding_system_for_read);
> > +   }
> 
> This is not needed, it is already checked later.  If
> buffer-file-coding-system cannot tolerate a non-coding-system then
> checks must be added somewhere else.

Why would it be a bad idea to disallow setting of
buffer-file-coding-system to an invalid value, as a subtle side effect
of calling this function?  By the time that later check is made, the
damage is already done.

IOW, why is it bad to be more defensive than is strictly necessary?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]