From: Dan Nicolaescu <dann@ics.uci.edu>
Subject: Problem report #26
Date: Mon, 10 Apr 2006 11:59:11 -0700 [thread overview]
Message-ID: <200604101859.k3AIxBJD005683@scanner2.ics.uci.edu> (raw)
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);
next reply other threads:[~2006-04-10 18:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-10 18:59 Dan Nicolaescu [this message]
2006-04-11 6:59 ` Problem report #26 Jan D.
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=200604101859.k3AIxBJD005683@scanner2.ics.uci.edu \
--to=dann@ics.uci.edu \
--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).