提交 312a238f 编写于 作者: A attila

8015674: CodeGenerator.initSymbols mutates a list

Reviewed-by: jlaskey, lagergren
上级 21efb47f
......@@ -456,17 +456,18 @@ final class CodeGenerator extends NodeOperatorVisitor<CodeGeneratorLexicalContex
}
private void initSymbols(final LinkedList<Symbol> symbols, final Type type) {
if (symbols.isEmpty()) {
return;
}
final Iterator<Symbol> it = symbols.iterator();
if(it.hasNext()) {
method.loadUndefined(type);
while (!symbols.isEmpty()) {
final Symbol symbol = symbols.removeFirst();
if (!symbols.isEmpty()) {
boolean hasNext;
do {
final Symbol symbol = it.next();
hasNext = it.hasNext();
if(hasNext) {
method.dup();
}
method.store(symbol);
} while(hasNext);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册