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

8015674: CodeGenerator.initSymbols mutates a list

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