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 #27 Date: Tue, 11 Apr 2006 09:00:58 +0200 Message-ID: <443B542A.7010005@swipnet.se> References: <200604101901.k3AJ1GMq006032@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 1144738929 16335 80.91.229.2 (11 Apr 2006 07:02:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 11 Apr 2006 07:02:09 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 11 09:02:05 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 1FTCt1-0002f3-Dz for ged-emacs-devel@m.gmane.org; Tue, 11 Apr 2006 09:02:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FTCt0-0006hr-Tc for ged-emacs-devel@m.gmane.org; Tue, 11 Apr 2006 03:02:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FTCs2-0006Nl-Gj for emacs-devel@gnu.org; Tue, 11 Apr 2006 03:01:02 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FTCs1-0006N4-HA for emacs-devel@gnu.org; Tue, 11 Apr 2006 03:01:01 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FTCs0-0006Ml-Q0 for emacs-devel@gnu.org; Tue, 11 Apr 2006 03:01:00 -0400 Original-Received: from [213.50.74.197] (helo=smtp.operax.com) by monty-python.gnu.org with smtp (Exim 4.52) id 1FTCwn-0007MU-SI for emacs-devel@gnu.org; Tue, 11 Apr 2006 03:05:58 -0400 Original-Received: (qmail 5218 invoked by uid 0); 11 Apr 2006 07:00:58 -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 07:00:58 -0000 User-Agent: Thunderbird 1.5 (X11/20051201) Original-To: emacs-devel@gnu.org In-Reply-To: <200604101901.k3AJ1GMq006032@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:52644 Archived-At: #18 once more. Jan D. Dan Nicolaescu wrote: > CID: 27 > 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 "save_wv" assigned value 0. > Also see events: [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 > 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 (1): "i < menu_items_used" taking true path > At conditional (7): "i < menu_items_used" taking true path > > 2698 while (i < menu_items_used) > 2699 { > > At conditional (2): "((0), (menu_items & -8))->contents[i] == Qnil" taking false path > At conditional (8): "((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; > 2703 save_wv = prev_wv; > 2704 prev_wv = 0; > 2705 first_pane = 1; > 2706 i++; > 2707 } > > At conditional (3): "((0), (menu_items & -8))->contents[i] == Qlambda" taking false path > At conditional (9): "((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 (4): "((0), (menu_items & -8))->contents[i] == Qt" taking true path > At conditional (5): "submenu_depth != 0" taking false path > At conditional (10): "((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 (6): "((0), (menu_items & -8))->contents[i] == Qquote" taking true path > At conditional (11): "((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 (12): "((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 (13): "item_name & 7 == 3" taking true path > At conditional (14): "((0), (item_name & -8))->size_byte >= 0" taking true path > > 2786 if (STRINGP (item_name) && STRING_MULTIBYTE (item_name)) > 2787 { > > At conditional (15): "Vlocale_coding_system != Qnil" taking true path > At conditional (16): "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 (17): "descrip & 7 == 3" taking true path > At conditional (18): "((0), (descrip & -8))->size_byte >= 0" taking true path > > 2792 if (STRINGP (descrip) && STRING_MULTIBYTE (descrip)) > 2793 { > > At conditional (19): "Vlocale_coding_system != Qnil" taking true path > At conditional (20): "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 (21): "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] > > 2803 save_wv->contents = wv; > 2804 wv->name = (char *) SDATA (item_name); > > > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel