diff --git a/ssc/compiler.cs b/ssc/compiler.cs index d1dc722..d99801f 100644 --- a/ssc/compiler.cs +++ b/ssc/compiler.cs @@ -89,7 +89,7 @@ namespace arookas { void CleanSymbols() { var i = 0; while (i < mContext.SymbolTable.Count) { - if (mContext.SymbolTable[i] is sunCallableSymbol && !mContext.SymbolTable[i].HasRelocations) { + if (!mContext.SymbolTable[i].HasRelocations) { mContext.SymbolTable.RemoveAt(i); continue; } @@ -102,6 +102,15 @@ namespace arookas { } builtin.Index = i; } + var vars = 0; + for (i = 0; i < mContext.SymbolTable.Count; ++i) { + var variable = mContext.SymbolTable[i] as sunVariableSymbol; + if (variable == null) { + continue; + } + variable.Display = 0; + variable.Index = vars++; + } } #endif void CompileRelocations() {