unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jan Djärv" <jan.h.d@swipnet.se>
Cc: emacs-devel@gnu.org
Subject: Re: Problem report #92
Date: Fri, 08 Sep 2006 13:41:32 +0200	[thread overview]
Message-ID: <450156EC.5020504@swipnet.se> (raw)
In-Reply-To: <200609072146.k87LkwxG001462@oogie-boogie.ics.uci.edu>



Dan Nicolaescu skrev:
> This appeared around August 25th. Can somebody please take a look and
> see whether it's a real problem or not. 
> 
> Thanks!

I think it is a real problem.  That said, I guess s->face->font always should 
be set, so in real life, the error does not happen.  However, it could be a 
good idea to abort instead if y does not get set, i.e.:

  	    else if (s->face->font)
	      y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2;
             else abort();

	Jan D.

> 
> CID: 92
> Checker: UNINIT (help)
> File: base/src/emacs/src/xterm.c
> Function: x_draw_glyph_string
> Description: Using uninitialized value "y" as argument to function "XFillRectangle"
> 
> 
> 2680 	  if (!s->for_overlaps)
> 2681 	    {
> 2682 	      /* Draw underline.  */
> 2683 	      if (s->face->underline_p)
> 2684 		{
> 2685 		  unsigned long tem, h;
> 
> Event var_decl: Declared variable "y" without initializer
> Also see events: [uninit_arg][uninit_arg]
> 
> 2686 		  int y;
> 2687 	
> 2688 		  /* Get the underline thickness.  Default is 1 pixel.  */
> 
> At conditional (1): "XGetFontProperty == 0" taking true path
> 
> 2689 		  if (!XGetFontProperty (s->font, XA_UNDERLINE_THICKNESS, &h))
> 2690 		    h = 1;
> 2691 	
> 
> At conditional (2): "x_underline_at_descent_line != 0" taking false path
> 
> 2692 	          if (x_underline_at_descent_line)
> 2693 		    y = s->y + s->height - h;
> 2694 	          else
> 2695 	            {
> 2696 		      /* Get the underline position.  This is the recommended
> 2697 	                 vertical offset in pixels from the baseline to the top of
> 2698 	                 the underline.  This is a signed value according to the
> 2699 	                 specs, and its default is
> 2700 	
> 2701 		         ROUND ((maximum descent) / 2), with
> 2702 		         ROUND(x) = floor (x + 0.5)  */
> 2703 	
> 
> At conditional (3): "x_use_underline_position_properties != 0" taking true path
> At conditional (4): "XGetFontProperty != 0" taking false path
> 
> 2704 	              if (x_use_underline_position_properties
> 2705 	                  && XGetFontProperty (s->font, XA_UNDERLINE_POSITION, &tem))
> 2706 	                y = s->ybase + (long) tem;
> 
> At conditional (5): "((s)->face)->font != 0" taking false path
> 
> 2707 	              else if (s->face->font)
> 2708 	                y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2;
> 2709 	            }
> 2710 	
> 
> At conditional (6): "((s)->face)->underline_defaulted_p != 0" taking true path
> 
> 2711 		  if (s->face->underline_defaulted_p)
> 
> Event uninit_arg: Using uninitialized value "y" as argument to function "XFillRectangle"
> Also see events: [var_decl][uninit_arg]
> 
> 2712 		    XFillRectangle (s->display, s->window, s->gc,
> 2713 				    s->x, y, s->background_width, h);
> 2714 		  else
> 2715 		    {
> 2716 		      XGCValues xgcv;
> 2717 		      XGetGCValues (s->display, s->gc, GCForeground, &xgcv);
> 2718 		      XSetForeground (s->display, s->gc, s->face->underline_color);
> 
> Event uninit_arg: Using uninitialized value "y" as argument to function "XFillRectangle"
> Also see events: [var_decl][uninit_arg]
> 
> 2719 		      XFillRectangle (s->display, s->window, s->gc,
> 2720 				      s->x, y, s->background_width, h);
> 2721 		      XSetForeground (s->display, s->gc, xgcv.foreground);
> 2722 		    }
> 2723 		}
> 2724 	
> 2725 	      /* Draw overline.  */
> 2726 	      if (s->face->overline_p)
> 2727 		{
> 
> 
> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-devel

      parent reply	other threads:[~2006-09-08 11:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-07 21:46 Problem report #92 Dan Nicolaescu
2006-09-08 11:34 ` Kim F. Storm
2006-09-08 11:41 ` Jan Djärv [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=450156EC.5020504@swipnet.se \
    --to=jan.h.d@swipnet.se \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).