Skip to content

Commit dc19ebd

Browse files
committed
Gracefully skip invalid ECPoint constant folding
1 parent 94746bc commit dc19ebd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Neo.Compiler.CSharp/MethodConvert/Expression/Expression.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,14 @@ private bool TryConvertConstant(SemanticModel model, ExpressionSyntax syntax, Sy
6363

6464
if (typeSymbol != null)
6565
{
66-
value = ConvertComplexConstantTypes(typeSymbol, value, syntax);
66+
try
67+
{
68+
value = ConvertComplexConstantTypes(typeSymbol, value, syntax);
69+
}
70+
catch (FormatException) when (syntaxNode is null)
71+
{
72+
// Defer to runtime conversion when not part of a definite declaration context.
73+
}
6774
}
6875

6976
Push(value);

0 commit comments

Comments
 (0)