fix regression: don't add 0 initializer when variable is assigned to anyway (or is loopvar in a for-loop)

This commit is contained in:
Irmen de Jong
2021-11-02 21:23:59 +01:00
parent bc0a133bb1
commit 3410aea788
3 changed files with 12 additions and 4 deletions

View File

@@ -10,6 +10,7 @@ prog8_lib {
word @zp retval_interm_w ; to store intermediary expression results for return values (hopefully allocated on ZP to reduce code size)
ubyte @zp retval_interm_ub ; to store intermediary expression results for return values (hopefully allocated on ZP to reduce code size)
byte @zp retval_interm_b ; to store intermediary expression results for return values (hopefully allocated on ZP to reduce code size)
; NOTE: these variables are checked in the StatementReorderer (in fun after(decl: VarDecl)), for these exact names!
asmsub pattern_match(str string @AY, str pattern @R0) clobbers(Y) -> ubyte @A {
%asm {{