From 386d4e6a1930c1e76693bd7240aeeeeaf1db612c Mon Sep 17 00:00:00 2001 From: Fraser Waters Date: Thu, 5 Oct 2017 15:32:39 +0100 Subject: [PATCH] Fix bug where count overrides didn't effect ComputeSize ComputeSize and ElementCount should match each other (and they do when read direct from XML spec files). However when using the override file to change count only ElementCount was effected. This is now fixed so that ComputeSize is set and also so that ElementCount gets reset to 0 if the count value isn't an integer. --- src/Generator.Bind/FuncProcessor.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Generator.Bind/FuncProcessor.cs b/src/Generator.Bind/FuncProcessor.cs index 7755f40e..c5ce9b52 100644 --- a/src/Generator.Bind/FuncProcessor.cs +++ b/src/Generator.Bind/FuncProcessor.cs @@ -536,11 +536,16 @@ namespace Bind d.Parameters[i].Flow = Parameter.GetFlowDirection((string)node.TypedValue); break; case "count": + d.Parameters[i].ComputeSize = node.Value.Trim(); int count; - if (Int32.TryParse(node.Value, out count)) + if (Int32.TryParse(d.Parameters[i].ComputeSize, out count)) { d.Parameters[i].ElementCount = count; } + else + { + d.Parameters[i].ElementCount = 0; + } break; } }