mirror of
https://github.com/irmen/prog8.git
synced 2024-12-22 18:30:01 +00:00
about var inits
This commit is contained in:
parent
7585b6ef6f
commit
9927af1095
@ -85,7 +85,7 @@ class SymbolTableMaker(private val program: PtProgram, private val options: Comp
|
||||
initialString = null
|
||||
initialArray = null
|
||||
val number = value.number
|
||||
initialNumeric = if(number==0.0) null else number // 0 as init value -> just uninitialized TODO weird?
|
||||
initialNumeric = number
|
||||
numElements = node.arraySize?.toInt()
|
||||
}
|
||||
}
|
||||
|
@ -471,6 +471,7 @@ internal class ProgramAndVarsGen(
|
||||
|
||||
private fun entrypointInitialization() {
|
||||
// zero out the BSS area first, before setting the variable init values
|
||||
// this is mainly to make sure the arrays are all zero'd out at program startup
|
||||
asmgen.out(" jsr prog8_lib.program_startup_clear_bss")
|
||||
|
||||
// initialize block-level (global) variables at program start
|
||||
|
@ -1,11 +1,6 @@
|
||||
TODO
|
||||
====
|
||||
|
||||
In ast2 allow PtVariable to still have a numeric initialization value in codegen. (instead of only array and string)
|
||||
why is 0 as value stored as null in symboltablemaker?
|
||||
|
||||
are variables initialized with 0 reset to 0 with an assignment? WHY is the BSS area then cleared with memset? shouldn't be necessary?
|
||||
|
||||
- unit test for defer
|
||||
- describe defer in the manual
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user