Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler int fixes #273

Merged
1 change: 1 addition & 0 deletions Compiler/script/cc_compiledscript.cpp
Expand Up @@ -149,6 +149,7 @@ int ccCompiledScript::remove_any_import (const char*namm, SymbolDef *oldSym) {
for (i = 0; i <= sym.get_num_args(sidx); i++) {
oldSym->funcparamtypes[i] = sym.funcparamtypes[sidx][i];
oldSym->funcParamDefaultValues[i] = sym.funcParamDefaultValues[sidx][i];
oldSym->funcParamHasDefaultValues[i] = sym.funcParamHasDefaultValues[sidx][i];
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion Compiler/script/cc_symboldef.h
Expand Up @@ -16,7 +16,8 @@ struct SymbolDef {
short sscope; // or num arguments for function
long arrsize;
unsigned long funcparamtypes[MAX_FUNCTION_PARAMETERS+1];
short funcParamDefaultValues[MAX_FUNCTION_PARAMETERS+1];
int funcParamDefaultValues[MAX_FUNCTION_PARAMETERS+1];
bool funcParamHasDefaultValues[MAX_FUNCTION_PARAMETERS+1];
};

#endif // __CC_SYMBOLDEF_H
4 changes: 3 additions & 1 deletion Compiler/script/cc_symboltable.cpp
Expand Up @@ -63,6 +63,7 @@ void symbolTable::reset() {
extends.resize(0);
funcparamtypes.resize(0);
funcParamDefaultValues.resize(0);
funcParamHasDefaultValues.resize(0);

numsymbols=0;
currentscope=0;
Expand Down Expand Up @@ -225,7 +226,8 @@ int symbolTable::add_ex(const char*nta,int typo,char sizee) {
arrsize.push_back(0);
extends.push_back(0);
funcparamtypes.push_back(std::vector<unsigned long>(MAX_FUNCTION_PARAMETERS + 1));
funcParamDefaultValues.push_back(std::vector<short>(MAX_FUNCTION_PARAMETERS + 1));
funcParamDefaultValues.push_back(std::vector<int>(MAX_FUNCTION_PARAMETERS + 1));
funcParamHasDefaultValues.push_back(std::vector<bool>(MAX_FUNCTION_PARAMETERS + 1));
symbolTree.addEntry(fullname, numsymbols);
numsymbols++;
return numsymbols-1;
Expand Down
3 changes: 2 additions & 1 deletion Compiler/script/cc_symboltable.h
Expand Up @@ -27,7 +27,8 @@ struct symbolTable {
std::vector<short> extends; // inherits another class (classes) / owning class (member vars)
// functions only, save types of return value and all parameters
std::vector<std::vector<unsigned long> > funcparamtypes;
std::vector<std::vector<short> > funcParamDefaultValues;
std::vector< std::vector<int> > funcParamDefaultValues;
std::vector< std::vector<bool> > funcParamHasDefaultValues;

ccTreeMap symbolTree;

Expand Down