mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
1. give limit to variable count & register count
2. expand register limit to uint16_t 3. introduce skip copying from stack allocated local variable to interpreter register file Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
d3b208a204
commit
76a249913a
68 changed files with 714 additions and 274 deletions
|
|
@ -150,6 +150,14 @@ void ScriptParser::generateCodeBlockTreeFromASTWalkerPostProcess(CodeBlock* cb)
|
|||
generateCodeBlockTreeFromASTWalkerPostProcess(cb->m_childBlocks[i]);
|
||||
}
|
||||
cb->computeVariables();
|
||||
if (cb->m_identifierOnStackCount > VARIABLE_LIMIT) {
|
||||
auto err = new esprima::Error(new ASCIIString("variable limit exceeded"));
|
||||
err->errorCode = ErrorObject::SyntaxError;
|
||||
err->lineNumber = cb->m_sourceElementStart.line;
|
||||
err->column = cb->m_sourceElementStart.column;
|
||||
err->index = cb->m_sourceElementStart.index;
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
ScriptParser::ScriptParserResult ScriptParser::parse(StringView scriptSource, String* fileName, CodeBlock* parentCodeBlock, bool strictFromOutside)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue