Commit 3643f849 authored by Sam Ravnborg's avatar Sam Ravnborg Committed by Michal Marek

kconfig: fix segfault when detecting recursive dependency

Following sample Kconfig generated a segfault:

config FOO
        bool
        select PERF_EVENTS if HAVE_HW_BREAKPOINT

config PERF_EVENTS
        bool

config HAVE_HW_BREAKPOINT
        bool
        depends on PERF_EVENTS

Fix by reverting back to a valid property if there was no
property on the stack of symbols.

The above pattern were seen in sh Kconfig.
A fix for the Kconfig file has been sent to the sh folks.
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
parent 84062dd3
...@@ -937,6 +937,8 @@ static void sym_check_print_recursive(struct symbol *last_sym) ...@@ -937,6 +937,8 @@ static void sym_check_print_recursive(struct symbol *last_sym)
sym = stack->sym; sym = stack->sym;
next_sym = stack->next ? stack->next->sym : last_sym; next_sym = stack->next ? stack->next->sym : last_sym;
prop = stack->prop; prop = stack->prop;
if (prop == NULL)
prop = stack->sym->prop;
/* for choice values find the menu entry (used below) */ /* for choice values find the menu entry (used below) */
if (sym_is_choice(sym) || sym_is_choice_value(sym)) { if (sym_is_choice(sym) || sym_is_choice_value(sym)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment