mirror of
https://github.com/irmen/prog8.git
synced 2025-08-09 19:25:22 +00:00
fix compiler crash with scoped const vardecls
This commit is contained in:
@@ -78,7 +78,7 @@ internal class BeforeAsmGenerationAstChanger(val program: Program, val errors: I
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun after(scope: AnonymousScope, parent: Node): Iterable<IAstModification> {
|
override fun after(scope: AnonymousScope, parent: Node): Iterable<IAstModification> {
|
||||||
val decls = scope.statements.filterIsInstance<VarDecl>()
|
val decls = scope.statements.filterIsInstance<VarDecl>().filter { it.type == VarDeclType.VAR }
|
||||||
subroutineVariables.addAll(decls.map { it.name to it })
|
subroutineVariables.addAll(decls.map { it.name to it })
|
||||||
|
|
||||||
val sub = scope.definingSubroutine()
|
val sub = scope.definingSubroutine()
|
||||||
|
@@ -1,11 +1,10 @@
|
|||||||
%import textio
|
|
||||||
%zeropage dontuse
|
|
||||||
|
|
||||||
main {
|
main {
|
||||||
uword hash_buckets = memory("buckets", 128*32*2)
|
sub start() {
|
||||||
|
if cx16.r0 {
|
||||||
sub start() {
|
const ubyte buffer_length = 255 ; less than 256
|
||||||
txt.print_uwhex(hash_buckets,true)
|
ubyte[255] buffer
|
||||||
txt.print("ok")
|
ubyte[buffer_length] buffer2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user