Update astNodes.cpp

strings that are arguments for a function need to be put into the global string table. PrecompileIdent does this for the function name etc so it pulls from that during compiled eval
This commit is contained in:
marauder2k7 2026-01-20 08:26:51 +00:00
parent 6e96c0510d
commit 3a4e2f8a7e

View file

@ -1529,6 +1529,7 @@ U32 FunctionDeclStmtNode::compileStmt(CodeStream& codeStream, U32 ip)
CodeBlock::smInFunction = false;
setCurrentStringTable(&getGlobalStringTable());
// check for argument setup
for (VarNode* walk = args; walk; walk = (VarNode*)((StmtNode*)walk)->getNext())
{
@ -1541,6 +1542,7 @@ U32 FunctionDeclStmtNode::compileStmt(CodeStream& codeStream, U32 ip)
ip = walk->defaultValue->compile(codeStream, ip, walkType);
}
}
setCurrentStringTable(&getFunctionStringTable());
codeStream.emit(OP_FUNC_DECL);
codeStream.emitSTE(fnName);