File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/compiler/scala/tools/nsc/backend/jvm Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -104,12 +104,14 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
104
104
if (settings.debug)
105
105
inform(" [running phase " + name + " on icode]" )
106
106
107
- if (settings.Xdce )
108
- for ((sym, cls) <- icodes.classes if inliner.isClosureClass(sym) && ! deadCode.liveClosures(sym)) {
107
+ if (settings.Xdce ) {
108
+ val classes = icodes.classes.keys.toList // copy to avoid mutating the map while iterating
109
+ for (sym <- classes if inliner.isClosureClass(sym) && ! deadCode.liveClosures(sym)) {
109
110
log(s " Optimizer eliminated ${sym.fullNameString}" )
110
111
deadCode.elidedClosures += sym
111
112
icodes.classes -= sym
112
113
}
114
+ }
113
115
114
116
// For predictably ordered error messages.
115
117
var sortedClasses = classes.values.toList sortBy (_.symbol.fullName)
You can’t perform that action at this time.
0 commit comments