Skip to content

Commit 36fce6a

Browse files
authored
Merge pull request #4051 from masatake/kconfig--typeref-dont-pop
Kconfig: avoid stack underflow when filling typeref filed
2 parents 6f434c5 + 3babfdb commit 36fce6a

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CC input.kconfig /^CC := gcc$/;" v
2-
CC_HAS_FOO input.kconfig /^config CC_HAS_FOO$/;" c
2+
CC_HAS_FOO input.kconfig /^config CC_HAS_FOO$/;" c typeref:typename:bool
33
CONFIG_CC_HAS_FOO input.kconfig /^config CC_HAS_FOO$/;" c
44
CONFIG_CC_HAS_FOO_MODULE input.kconfig /^config CC_HAS_FOO$/;" c
55
stringify input.kconfig /^stringify = $(squote)$(quote)$1$(quote)$(squote)$/;" v

Units/parser-kconfig.r/simple-kconfig.d/expected.tags

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ net/mptcp/Kconfig input-3.kconfig /^source "net\/mptcp\/Kconfig"$/;" k menu:Netw
115115
NETWORK_SECMARK input-3.kconfig /^config NETWORK_SECMARK$/;" c menu:Networking options typeref:typename:bool roles:def
116116
CONFIG_NETWORK_SECMARK input-3.kconfig /^config NETWORK_SECMARK$/;" c menu:Networking options roles:def
117117
CONFIG_NETWORK_SECMARK_MODULE input-3.kconfig /^config NETWORK_SECMARK$/;" c menu:Networking options roles:def
118-
NET_PTP_CLASSIFY input-3.kconfig /^config NET_PTP_CLASSIFY$/;" c menu:Networking options roles:def
118+
NET_PTP_CLASSIFY input-3.kconfig /^config NET_PTP_CLASSIFY$/;" c menu:Networking options typeref:typename:bool roles:def
119119
CONFIG_NET_PTP_CLASSIFY input-3.kconfig /^config NET_PTP_CLASSIFY$/;" c menu:Networking options roles:def
120120
CONFIG_NET_PTP_CLASSIFY_MODULE input-3.kconfig /^config NET_PTP_CLASSIFY$/;" c menu:Networking options roles:def
121121
NETWORK_PHY_TIMESTAMPING input-3.kconfig /^config NETWORK_PHY_TIMESTAMPING$/;" c menu:Networking options typeref:typename:bool roles:def

optlib/kconfig.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ extern parserDefinition* KconfigParser (void)
7676
"{{\n"
7777
" .\n"
7878
"}}", NULL, false},
79-
{"^[ \t]*(bool|boolean|hex|int|string|tristate)\\>", "",
79+
{"^[ \t]*(def_)?(bool|boolean|hex|int|string|tristate)\\>", "",
8080
"", "{exclusive}"
8181
"{{\n"
8282
" count 0 gt {\n"
83-
" \\1 typeref:\n"
84-
" pop\n"
83+
" \\2 typeref:\n"
84+
" clear\n"
8585
" } if\n"
8686
"}}", NULL, false},
8787
{"^[ \t]*(menu)?config[ \t]+([A-Za-z0-9_]+)[ \t]*$", "CONFIG_\\2",

optlib/kconfig.ctags

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@
5656
--regex-Kconfig=/^[ \t]*(menu)?config[ \t]+([A-Za-z0-9_]+)[ \t]*$/\2/c/{scope=ref}{{
5757
.
5858
}}
59-
--regex-Kconfig=/^[ \t]*(bool|boolean|hex|int|string|tristate)\>///{exclusive}{{
59+
--regex-Kconfig=/^[ \t]*(def_)?(bool|boolean|hex|int|string|tristate)\>///{exclusive}{{
6060
count 0 gt {
61-
\1 typeref:
62-
pop
61+
\2 typeref:
62+
clear
6363
} if
6464
}}
6565
--regex-Kconfig=/^[ \t]*(menu)?config[ \t]+([A-Za-z0-9_]+)[ \t]*$/CONFIG_\2/c/{scope=ref}{_extra=configPrefixed}

0 commit comments

Comments
 (0)