GNU bug report logs - #37756
[PATCH] Wrong initialization of fringe bitmap

Previous Next

Package: emacs;

Reported by: Carlos Pita <carlosjosepita <at> gmail.com>

Date: Tue, 15 Oct 2019 02:40:02 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 37756 <at> debbugs.gnu.org
Subject: bug#37756: [PATCH] Wrong initialization of fringe bitmap
Date: Tue, 15 Oct 2019 07:14:25 -0300
> Can you explain your reasoning?  The loop after that does initialize

Ok, TBH I hadn't looked at the loop. But anyway:

> >   xfb = xmalloc (sizeof fb + fb.height * BYTES_PER_BITMAP_ROW);

This allocates fb.height * BYTES_PER_BITMAP_ROW for bits = b.

> >   memset (b, 0, fb.height);

This only initializes fb.height bytes to zero.

And then the loop indeed initializes all fb.height *
BYTES_PER_BITMAP_ROW bytes (b being an unsigned short pointer):

  j = 0;
  while (j < fb.height)
    {
       ...
       b[j++] = something;
       ...
    }

So instead of memset (b, 0, fb.height) being incomplete I would now
say that it is redundant and misleading.




This bug report was last modified 5 years and 210 days ago.

Previous Next


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