From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Jan D." Newsgroups: gmane.emacs.devel Subject: Re: Problem report #26 Date: Tue, 11 Apr 2006 08:59:51 +0200 Message-ID: <443B53E7.6050605@swipnet.se> References: <200604101859.k3AIxBJD005683@scanner2.ics.uci.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1144738841 16065 80.91.229.2 (11 Apr 2006 07:00:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 11 Apr 2006 07:00:41 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 11 09:00:39 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FTCrd-0002S7-CD for ged-emacs-devel@m.gmane.org; Tue, 11 Apr 2006 09:00:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FTCrc-000655-U4 for ged-emacs-devel@m.gmane.org; Tue, 11 Apr 2006 03:00:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FTCqw-0005uN-R6 for emacs-devel@gnu.org; Tue, 11 Apr 2006 02:59:54 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FTCqw-0005tw-0h for emacs-devel@gnu.org; Tue, 11 Apr 2006 02:59:54 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FTCqv-0005ts-OV for emacs-devel@gnu.org; Tue, 11 Apr 2006 02:59:53 -0400 Original-Received: from [213.50.74.197] (helo=smtp.operax.com) by monty-python.gnu.org with smtp (Exim 4.52) id 1FTCvj-0007AR-GW for emacs-devel@gnu.org; Tue, 11 Apr 2006 03:04:52 -0400 Original-Received: (qmail 90452 invoked by uid 0); 11 Apr 2006 06:59:51 -0000 Original-Received: from dentan.operax.com (HELO ?192.168.1.48?) (192.168.1.48) by treo.operax.com with SMTP; 11 Apr 2006 06:59:51 -0000 User-Agent: Thunderbird 1.5 (X11/20051201) Original-To: emacs-devel@gnu.org In-Reply-To: <200604101859.k3AIxBJD005683@scanner2.ics.uci.edu> X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:52642 Archived-At: As #18 again. Jan D. Dan Nicolaescu wrote: > CID: 26 > Checker: FORWARD_NULL (help) > File: emacs/src/xmenu.c > Function: xmenu_show > Description: Variable "save_wv" tracked as NULL was dereferenced. > > Event assign_zero: Variable "prev_wv" assigned value 0. > Also see events: [alias_transfer][var_deref_op] > > 2668 widget_value *wv, *save_wv = 0, *first_wv = 0, *prev_wv = 0; > 2669 widget_value **submenu_stack > 2670 = (widget_value **) alloca (menu_items_used * sizeof (widget_value *)); > 2671 Lisp_Object *subprefix_stack > 2672 = (Lisp_Object *) alloca (menu_items_used * sizeof (Lisp_Object)); > 2673 int submenu_depth = 0; > 2674 > 2675 int first_pane; > 2676 > 2677 *error = NULL; > 2678 > > At conditional (1): "menu_items_used <= 3" taking false path > > 2679 if (menu_items_used <= MENU_ITEMS_PANE_LENGTH) > 2680 { > 2681 *error = "Empty menu"; > 2682 return Qnil; > 2683 } > 2684 > 2685 /* Create a tree of widget_value objects > 2686 representing the panes and their items. */ > 2687 wv = xmalloc_widget_value (); > 2688 wv->name = "menu"; > 2689 wv->value = 0; > 2690 wv->enabled = 1; > 2691 wv->button_type = BUTTON_TYPE_NONE; > 2692 wv->help =Qnil; > 2693 first_wv = wv; > 2694 first_pane = 1; > 2695 > 2696 /* Loop over all panes and items, filling in the tree. */ > 2697 i = 0; > > At conditional (2): "i < menu_items_used" taking true path > At conditional (4): "i < menu_items_used" taking true path > > 2698 while (i < menu_items_used) > 2699 { > > At conditional (3): "((0), (menu_items & -8))->contents[i] == Qnil" taking true path > At conditional (5): "((0), (menu_items & -8))->contents[i] == Qnil" taking false path > > 2700 if (EQ (XVECTOR (menu_items)->contents[i], Qnil)) > 2701 { > 2702 submenu_stack[submenu_depth++] = save_wv; > > Event alias_transfer: Variable "save_wv" tracked as NULL because of assignment to "prev_wv" > Also see events: [assign_zero][var_deref_op] > > 2703 save_wv = prev_wv; > 2704 prev_wv = 0; > 2705 first_pane = 1; > 2706 i++; > 2707 } > > At conditional (6): "((0), (menu_items & -8))->contents[i] == Qlambda" taking false path > > 2708 else if (EQ (XVECTOR (menu_items)->contents[i], Qlambda)) > 2709 { > 2710 prev_wv = save_wv; > 2711 save_wv = submenu_stack[--submenu_depth]; > 2712 first_pane = 0; > 2713 i++; > 2714 } > > At conditional (7): "((0), (menu_items & -8))->contents[i] == Qt" taking false path > > 2715 else if (EQ (XVECTOR (menu_items)->contents[i], Qt) > 2716 && submenu_depth != 0) > 2717 i += MENU_ITEMS_PANE_LENGTH; > 2718 /* Ignore a nil in the item list. > 2719 It's meaningful only for dialog boxes. */ > > At conditional (8): "((0), (menu_items & -8))->contents[i] == Qquote" taking false path > > 2720 else if (EQ (XVECTOR (menu_items)->contents[i], Qquote)) > 2721 i += 1; > > At conditional (9): "((0), (menu_items & -8))->contents[i] == Qt" taking false path > > 2722 else if (EQ (XVECTOR (menu_items)->contents[i], Qt)) > 2723 { > 2724 /* Create a new pane. */ > 2725 Lisp_Object pane_name, prefix; > 2726 char *pane_string; > 2727 > 2728 pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME); > 2729 prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX); > 2730 > 2731 #ifndef HAVE_MULTILINGUAL_MENU > 2732 if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name)) > 2733 { > 2734 pane_name = ENCODE_MENU_STRING (pane_name); > 2735 AREF (menu_items, i + MENU_ITEMS_PANE_NAME) = pane_name; > 2736 } > 2737 #endif > 2738 pane_string = (NILP (pane_name) > 2739 ? "" : (char *) SDATA (pane_name)); > 2740 /* If there is just one top-level pane, put all its items directly > 2741 under the top-level menu. */ > 2742 if (menu_items_n_panes == 1) > 2743 pane_string = ""; > 2744 > 2745 /* If the pane has a meaningful name, > 2746 make the pane a top-level menu item > 2747 with its items as a submenu beneath it. */ > 2748 if (!keymaps && strcmp (pane_string, "")) > 2749 { > 2750 wv = xmalloc_widget_value (); > 2751 if (save_wv) > 2752 save_wv->next = wv; > 2753 else > 2754 first_wv->contents = wv; > 2755 wv->name = pane_string; > 2756 if (keymaps && !NILP (prefix)) > 2757 wv->name++; > 2758 wv->value = 0; > 2759 wv->enabled = 1; > 2760 wv->button_type = BUTTON_TYPE_NONE; > 2761 wv->help = Qnil; > 2762 save_wv = wv; > 2763 prev_wv = 0; > 2764 } > 2765 else if (first_pane) > 2766 { > 2767 save_wv = wv; > 2768 prev_wv = 0; > 2769 } > 2770 first_pane = 0; > 2771 i += MENU_ITEMS_PANE_LENGTH; > 2772 } > 2773 else > 2774 { > 2775 /* Create a new item within current pane. */ > 2776 Lisp_Object item_name, enable, descrip, def, type, selected, help; > 2777 item_name = AREF (menu_items, i + MENU_ITEMS_ITEM_NAME); > 2778 enable = AREF (menu_items, i + MENU_ITEMS_ITEM_ENABLE); > 2779 descrip = AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY); > 2780 def = AREF (menu_items, i + MENU_ITEMS_ITEM_DEFINITION); > 2781 type = AREF (menu_items, i + MENU_ITEMS_ITEM_TYPE); > 2782 selected = AREF (menu_items, i + MENU_ITEMS_ITEM_SELECTED); > 2783 help = AREF (menu_items, i + MENU_ITEMS_ITEM_HELP); > 2784 > 2785 #ifndef HAVE_MULTILINGUAL_MENU > > At conditional (10): "item_name & 7 == 3" taking true path > At conditional (11): "((0), (item_name & -8))->size_byte >= 0" taking true path > > 2786 if (STRINGP (item_name) && STRING_MULTIBYTE (item_name)) > 2787 { > > At conditional (12): "Vlocale_coding_system != Qnil" taking true path > At conditional (13): "Vlocale_coding_system != 0" taking true path > > 2788 item_name = ENCODE_MENU_STRING (item_name); > 2789 AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name; > 2790 } > 2791 > > At conditional (14): "descrip & 7 == 3" taking true path > At conditional (15): "((0), (descrip & -8))->size_byte >= 0" taking true path > > 2792 if (STRINGP (descrip) && STRING_MULTIBYTE (descrip)) > 2793 { > > At conditional (16): "Vlocale_coding_system != Qnil" taking true path > At conditional (17): "Vlocale_coding_system != 0" taking true path > > 2794 descrip = ENCODE_MENU_STRING (descrip); > 2795 AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip; > 2796 } > 2797 #endif /* not HAVE_MULTILINGUAL_MENU */ > 2798 > 2799 wv = xmalloc_widget_value (); > > At conditional (18): "prev_wv != 0" taking false path > > 2800 if (prev_wv) > 2801 prev_wv->next = wv; > 2802 else > > Event var_deref_op: Variable "save_wv" tracked as NULL was dereferenced. > Also see events: [assign_zero][alias_transfer] > > 2803 save_wv->contents = wv; > 2804 wv->name = (char *) SDATA (item_name); > 2805 if (!NILP (descrip)) > 2806 wv->key = (char *) SDATA (descrip); > > > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel