Skip to content

Commit

Permalink
Merge pull request #4051 from masatake/kconfig--typeref-dont-pop
Browse files Browse the repository at this point in the history
Kconfig: avoid stack underflow when filling typeref filed
  • Loading branch information
masatake authored Aug 15, 2024
2 parents 6f434c5 + 3babfdb commit 36fce6a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Units/parser-kconfig.r/macros.d/expected.tags
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CC input.kconfig /^CC := gcc$/;" v
CC_HAS_FOO input.kconfig /^config CC_HAS_FOO$/;" c
CC_HAS_FOO input.kconfig /^config CC_HAS_FOO$/;" c typeref:typename:bool
CONFIG_CC_HAS_FOO input.kconfig /^config CC_HAS_FOO$/;" c
CONFIG_CC_HAS_FOO_MODULE input.kconfig /^config CC_HAS_FOO$/;" c
stringify input.kconfig /^stringify = $(squote)$(quote)$1$(quote)$(squote)$/;" v
2 changes: 1 addition & 1 deletion Units/parser-kconfig.r/simple-kconfig.d/expected.tags
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ net/mptcp/Kconfig input-3.kconfig /^source "net\/mptcp\/Kconfig"$/;" k menu:Netw
NETWORK_SECMARK input-3.kconfig /^config NETWORK_SECMARK$/;" c menu:Networking options typeref:typename:bool roles:def
CONFIG_NETWORK_SECMARK input-3.kconfig /^config NETWORK_SECMARK$/;" c menu:Networking options roles:def
CONFIG_NETWORK_SECMARK_MODULE input-3.kconfig /^config NETWORK_SECMARK$/;" c menu:Networking options roles:def
NET_PTP_CLASSIFY input-3.kconfig /^config NET_PTP_CLASSIFY$/;" c menu:Networking options roles:def
NET_PTP_CLASSIFY input-3.kconfig /^config NET_PTP_CLASSIFY$/;" c menu:Networking options typeref:typename:bool roles:def
CONFIG_NET_PTP_CLASSIFY input-3.kconfig /^config NET_PTP_CLASSIFY$/;" c menu:Networking options roles:def
CONFIG_NET_PTP_CLASSIFY_MODULE input-3.kconfig /^config NET_PTP_CLASSIFY$/;" c menu:Networking options roles:def
NETWORK_PHY_TIMESTAMPING input-3.kconfig /^config NETWORK_PHY_TIMESTAMPING$/;" c menu:Networking options typeref:typename:bool roles:def
Expand Down
6 changes: 3 additions & 3 deletions optlib/kconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ extern parserDefinition* KconfigParser (void)
"{{\n"
" .\n"
"}}", NULL, false},
{"^[ \t]*(bool|boolean|hex|int|string|tristate)\\>", "",
{"^[ \t]*(def_)?(bool|boolean|hex|int|string|tristate)\\>", "",
"", "{exclusive}"
"{{\n"
" count 0 gt {\n"
" \\1 typeref:\n"
" pop\n"
" \\2 typeref:\n"
" clear\n"
" } if\n"
"}}", NULL, false},
{"^[ \t]*(menu)?config[ \t]+([A-Za-z0-9_]+)[ \t]*$", "CONFIG_\\2",
Expand Down
6 changes: 3 additions & 3 deletions optlib/kconfig.ctags
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@
--regex-Kconfig=/^[ \t]*(menu)?config[ \t]+([A-Za-z0-9_]+)[ \t]*$/\2/c/{scope=ref}{{
.
}}
--regex-Kconfig=/^[ \t]*(bool|boolean|hex|int|string|tristate)\>///{exclusive}{{
--regex-Kconfig=/^[ \t]*(def_)?(bool|boolean|hex|int|string|tristate)\>///{exclusive}{{
count 0 gt {
\1 typeref:
pop
\2 typeref:
clear
} if
}}
--regex-Kconfig=/^[ \t]*(menu)?config[ \t]+([A-Za-z0-9_]+)[ \t]*$/CONFIG_\2/c/{scope=ref}{_extra=configPrefixed}
Expand Down

0 comments on commit 36fce6a

Please sign in to comment.