fix asm code optimization problem caused in previous release where asm file is not read back in separate lines anymore

This commit is contained in:
Irmen de Jong 2021-12-10 15:37:53 +01:00
parent 33061aaa0d
commit 75ea453bf4

View File

@ -79,6 +79,10 @@ class AsmGen(private val program: Program,
footer() footer()
if(options.optimize) { if(options.optimize) {
val separateLines = assemblyLines.flatMap { it.split('\n') }
assemblyLines.clear()
assemblyLines.addAll(separateLines)
require(assemblyLines.all { !it.contains('\n') })
var optimizationsDone = 1 var optimizationsDone = 1
while (optimizationsDone > 0) { while (optimizationsDone > 0) {
optimizationsDone = optimizeAssembly(assemblyLines, options.compTarget.machine, program) optimizationsDone = optimizeAssembly(assemblyLines, options.compTarget.machine, program)