From 694210cd5a6ff6440bdc3bd170ca796919736ee6 Mon Sep 17 00:00:00 2001 From: arookas Date: Mon, 21 Dec 2015 04:55:00 -0500 Subject: [PATCH] Fixed: incorrect variable count in header. --- ssc/context.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ssc/context.cs b/ssc/context.cs index 2b14c37..fe44cad 100644 --- a/ssc/context.cs +++ b/ssc/context.cs @@ -10,6 +10,7 @@ namespace arookas { aBinaryWriter writer; uint textOffset, dataOffset, symbolOffset; + int varCount; public sunWriter Text { get; private set; } public sunDataTable DataTable { get; private set; } @@ -93,6 +94,7 @@ namespace arookas ImportResolver.EnterFile(file); var parser = new sunParser(); var tree = parser.Parse(file); + varCount += tree.MaxLocalCount; tree.Compile(this); ImportResolver.ExitFile(file); } @@ -236,7 +238,7 @@ namespace arookas writer.WriteS32(DataTable.Count); writer.Write32(symbolOffset); writer.WriteS32(SymbolTable.Count); - writer.WriteS32(Scopes.Root.VariableCount); + writer.WriteS32(varCount); } }