From 2d69fd06f5593a4cda63c8c51290a4e37f8f27bf Mon Sep 17 00:00:00 2001 From: Aleksey Kliger Date: Fri, 20 Sep 2024 11:03:44 -0400 Subject: [PATCH] [aot] mono_aot_split_options: reset state after a backslash Fixes https://github.com/dotnet/runtime/issues/108066 --- src/mono/mono/mini/aot-compiler.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mono/mono/mini/aot-compiler.c b/src/mono/mono/mini/aot-compiler.c index fa52e9dd7521c6..000ea399f6210c 100644 --- a/src/mono/mono/mini/aot-compiler.c +++ b/src/mono/mono/mini/aot-compiler.c @@ -8744,8 +8744,14 @@ mono_aot_split_options (const char *aot_options) g_return_val_if_fail (aot_options != NULL, NULL); while ((cur = *aot_options) != '\0') { - if (state == MONO_AOT_OPTION_STATE_ESCAPE) + if (state == MONO_AOT_OPTION_STATE_ESCAPE) { + // After the escaped character, we're back inside quotes + // + // Note: we don't seem to remove the "" or the \ from the option here. + // Perhaps the caller is expected to take care of it? + state = MONO_AOT_OPTION_STATE_STRING; goto next; + } switch (cur) { case '"':