fixed a compiler crash because with noopt, strings weren't put on the heap

This commit is contained in:
Irmen de Jong 2019-03-07 22:04:00 +01:00
parent aa98104d54
commit 28277469b6
3 changed files with 4 additions and 4 deletions

View File

@ -104,10 +104,12 @@ private fun compileMain(args: Array<String>) {
}
//println(" time4: $time4")
val allScopedSymbolDefinitions = moduleAst.checkIdentifiers(heap) // useful for checking symbol usage later?
// moduleAst.simplifyExpressions(namespace, heap)
// moduleAst.optimizeStatements(namespace, heap)
if(optimize) {
// optimize the parse tree
println("Optimizing...")
val allScopedSymbolDefinitions = moduleAst.checkIdentifiers(heap) // useful for checking symbol usage later?
while (true) {
// keep optimizing expressions and statements until no more steps remain
val optsDone1 = moduleAst.simplifyExpressions(namespace, heap)

View File

@ -33,6 +33,7 @@ fun Module.checkIdentifiers(heap: HeapValues): MutableMap<String, IStatement> {
}
else -> TODO("replace literalvalue by identifierref: $variable (in $parent)")
}
variable.second.linkParents(scope as Node)
}
printErrors(checker.result(), name)

View File

@ -5,9 +5,6 @@
; @todo see problem in looplabelproblem.p8
; @todo when using -noopt, the error "can only push address of string that is a variable on the heap" appears when using strings
sub start() {