mirror of
https://github.com/irmen/prog8.git
synced 2026-04-20 11:17:01 +00:00
Merge branch 'master' into structs
# Conflicts: # compiler/test/codegeneration/TestVariables.kt # docs/source/_static/symboldumps/skeletons-c128.txt # docs/source/_static/symboldumps/skeletons-c64.txt # docs/source/_static/symboldumps/skeletons-cx16.txt # docs/source/_static/symboldumps/skeletons-pet32.txt # docs/source/_static/symboldumps/skeletons-virtual.txt # docs/source/todo.rst # examples/test.p8
This commit is contained in:
@@ -72,12 +72,12 @@ class IRCodeGen(
|
||||
val initValue = initialization?.value
|
||||
when(initValue){
|
||||
is PtBool -> {
|
||||
require(initValue.asInt()!=0) { "boolean var should not be initialized with false, it wil be set to false as part of BSS clear, initializer=$initialization" }
|
||||
require(initValue.asInt()!=0 || variable.zpwish!=ZeropageWish.NOT_IN_ZEROPAGE) { "non-zp variable should not be initialized with 0, it will already be zeroed as part of BSS clear, initializer=$initialization" }
|
||||
variable.setOnetimeInitNumeric(initValue.asInt().toDouble())
|
||||
initsToRemove += block to initialization
|
||||
}
|
||||
is PtNumber -> {
|
||||
require(initValue.number!=0.0 || variable.zpwish!=ZeropageWish.NOT_IN_ZEROPAGE) {"non-zp variable should not be initialized with 0, it will already be zeroed as part of BSS clear, initializer=$initialization" }
|
||||
require(initValue.number!=0.0 || variable.zpwish!=ZeropageWish.NOT_IN_ZEROPAGE) { "non-zp variable should not be initialized with 0, it will already be zeroed as part of BSS clear, initializer=$initialization" }
|
||||
variable.setOnetimeInitNumeric(initValue.number)
|
||||
initsToRemove += block to initialization
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user