mirror of
https://github.com/irmen/prog8.git
synced 2025-01-26 19:30:59 +00:00
fix callgraph issue when module gets removed by optimizations
This commit is contained in:
parent
80f39e8097
commit
c11a9b8709
@ -56,9 +56,11 @@ class CallGraph(private val program: Program) : IAstVisitor {
|
||||
override fun visit(directive: Directive) {
|
||||
val thisModule = directive.definingModule
|
||||
if (directive.directive == "%import") {
|
||||
val importedModule: Module = program.modules.single { it.name == directive.args[0].name }
|
||||
imports[thisModule] = imports.getValue(thisModule) + importedModule
|
||||
importedBy[importedModule] = importedBy.getValue(importedModule) + thisModule
|
||||
val importedModule = program.modules.singleOrNull { it.name == directive.args[0].name } // the module may no longer exist at all due to optimizations
|
||||
if(importedModule!=null) {
|
||||
imports[thisModule] = imports.getValue(thisModule) + importedModule
|
||||
importedBy[importedModule] = importedBy.getValue(importedModule) + thisModule
|
||||
}
|
||||
}
|
||||
|
||||
super.visit(directive)
|
||||
|
@ -3,6 +3,7 @@ TODO
|
||||
|
||||
Petaxian has gameplay problems on the C64 (with and without optimization) , cx16 target is fine.
|
||||
(seems unrelated to boolean type changes. 10.1 was still fine.)
|
||||
caused by 358215e4ddf408e568ded0d36afce9f0162e21d1 Removed PostIncrDecr
|
||||
|
||||
|
||||
...
|
||||
|
Loading…
x
Reference in New Issue
Block a user