summaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/menu.c
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2013-05-30 15:21:48 +0200
committerMichal Marek <mmarek@suse.cz>2013-05-30 15:21:48 +0200
commit42a0940d9d582214a8d0f8ba41f2b4fe987e21b0 (patch)
tree4306b63c01c75d1b6bb8a8a3d1c28494a4495325 /scripts/kconfig/menu.c
parentad06156876c0e55a01e13e1f2dd5c7f9262b1dfa (diff)
parente983b7b17ad1a978e954e6aaa62cf12bfc747883 (diff)
downloadlinux-42a0940d9d582214a8d0f8ba41f2b4fe987e21b0.tar.bz2
Merge branch 'yem-kconfig-rc-fixes' of git://gitorious.org/linux-kconfig/linux-kconfig into kbuild/rc-fixes
Diffstat (limited to 'scripts/kconfig/menu.c')
-rw-r--r--scripts/kconfig/menu.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index b5c7d90df9df..fd3f0180e08f 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -146,11 +146,24 @@ struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *e
struct menu *menu = current_entry;
while ((menu = menu->parent) != NULL) {
+ struct expr *dup_expr;
+
if (!menu->visibility)
continue;
+ /*
+ * Do not add a reference to the
+ * menu's visibility expression but
+ * use a copy of it. Otherwise the
+ * expression reduction functions
+ * will modify expressions that have
+ * multiple references which can
+ * cause unwanted side effects.
+ */
+ dup_expr = expr_copy(menu->visibility);
+
prop->visible.expr
= expr_alloc_and(prop->visible.expr,
- menu->visibility);
+ dup_expr);
}
}