aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/mono-6.12.0-fix-ConditionParser.patch
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches/mono-6.12.0-fix-ConditionParser.patch')
-rw-r--r--gnu/packages/patches/mono-6.12.0-fix-ConditionParser.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/gnu/packages/patches/mono-6.12.0-fix-ConditionParser.patch b/gnu/packages/patches/mono-6.12.0-fix-ConditionParser.patch
new file mode 100644
index 0000000000..4ecde07d42
--- /dev/null
+++ b/gnu/packages/patches/mono-6.12.0-fix-ConditionParser.patch
@@ -0,0 +1,46 @@
+diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionParser.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionParser.cs
+index b5e2e809ae4..757492d15e4 100644
+--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionParser.cs
++++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionParser.cs
+@@ -205,19 +205,30 @@ ConditionExpression ParseFunctionExpression (string function_name)
+ {
+ List <ConditionFactorExpression> list = new List <ConditionFactorExpression> ();
+ ConditionFactorExpression e;
+-
++
++ /* starts looking at the open paren, move past it */
++ tokenizer.GetNextToken ();
++ if (tokenizer.Token.Type == TokenType.RightParen) {
++ /* leave us looking past the end of the argument list */
++ tokenizer.GetNextToken ();
++ return list;
++ }
+ while (true) {
+- tokenizer.GetNextToken ();
+- if (tokenizer.Token.Type == TokenType.RightParen) {
+- tokenizer.GetNextToken ();
+- break;
+- }
+- if (tokenizer.Token.Type == TokenType.Comma)
++ e = (ConditionFactorExpression) ParseFactorExpression ();
++ list.Add (e);
++ /* ParseFactorExpression leaves us looking at what follows the
++ * expression */
++ if (tokenizer.Token.Type == TokenType.RightParen) {
++ /* leave us looking past the end of the argument list */
++ tokenizer.GetNextToken ();
++ break;
++ }
++ if (tokenizer.Token.Type == TokenType.Comma) {
++ tokenizer.GetNextToken ();
+ continue;
+-
+- tokenizer.Putback (tokenizer.Token);
+- e = (ConditionFactorExpression) ParseFactorExpression ();
+- list.Add (e);
++ }
++
++ throw new ExpressionParseException (String.Format ("Unexpected token {0} in argument list while parsing condition \"{1}\"", tokenizer.Token, conditionStr));
+ }
+
+ return list;