Write out variable mapping table to DSO stream, and fix .dump()

This commit is contained in:
Jeff Hutchinson 2021-09-01 22:15:37 -04:00
parent 9448256422
commit 8d75d60f91
4 changed files with 60 additions and 15 deletions

View file

@ -1594,10 +1594,12 @@ U32 FunctionDeclStmtNode::compileStmt(CodeStream& codeStream, U32 ip)
setCurrentFloatTable(&getGlobalFloatTable());
// map local variables to registers for this function.
// Note we have to map these in order because the table itself is ordered by the register id.
CompilerLocalVariableToRegisterMappingTable* tbl = &getFunctionVariableMappingTable();
for (const auto& pair : gFuncVars->variableNameMap)
for (size_t i = 0; i < gFuncVars->variableNameMap.size(); ++i)
{
tbl->add(fnName, nameSpace, pair.second, pair.first);
StringTableEntry varName = gFuncVars->variableNameMap[i];
tbl->add(fnName, nameSpace, varName);
}
gFuncVars = NULL;