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