diff --git a/ssc/compiler.cs b/ssc/compiler.cs index 8ff892d..5bc3dc7 100644 --- a/ssc/compiler.cs +++ b/ssc/compiler.cs @@ -131,7 +131,7 @@ namespace arookas { #endif void CompileRelocations() { foreach (var symbol in mContext.SymbolTable) { - symbol.CloseRelocations(this); + symbol.CloseRelocations(); } } void CompileData() { diff --git a/ssc/scope.cs b/ssc/scope.cs index 0c67263..11a5974 100644 --- a/ssc/scope.cs +++ b/ssc/scope.cs @@ -53,7 +53,7 @@ namespace arookas { mStack.Add(new sunScope(type)); } #endif - public void Pop(sunCompiler compiler) { + public void Pop() { if (Count > 1) { #if SSC_SCOPES if (Top.Type == sunScopeType.Script) { @@ -62,7 +62,7 @@ namespace arookas { #else // close relocations while we still have references to the symbols foreach (var variable in Top) { - variable.CloseRelocations(compiler); + variable.CloseRelocations(); } #endif mStack.RemoveAt(Count - 1); diff --git a/ssc/symbol.cs b/ssc/symbol.cs index 685ab62..72d678f 100644 --- a/ssc/symbol.cs +++ b/ssc/symbol.cs @@ -90,12 +90,10 @@ namespace arookas { } mRelocations.Add(relocation); } - public void CloseRelocations(sunCompiler compiler) { - compiler.Binary.Keep(); + public void CloseRelocations() { foreach (var relocation in mRelocations) { relocation.Relocate(); } - compiler.Binary.Back(); } public static sunSymbolModifiers GetModifiers(sunNode modifierlist) { @@ -202,7 +200,7 @@ namespace arookas { } mBody.Compile(compiler); compiler.Binary.WriteRET0(); - compiler.Context.Scopes.Pop(compiler); + compiler.Context.Scopes.Pop(); ++mCompiles; } public override sunRelocation CreateCallSite(sunCompiler compiler, int argCount) {