fixed memory corruption in case of garbage collection during assignment
This commit is contained in:
1 parent
2126085899
commit
461e6e0b84
1 file changed
+19
-23
@@ -37,13 +37,30 @@ assign_variable:
|
|||||||
jsr is_var_ST
|
jsr is_var_ST
|
||||||
beq_16 do_SYNTAX_error
|
beq_16 do_SYNTAX_error
|
||||||
|
|
||||||
// XXX add support for arrays
|
// Push the VARNAM to the stack - it might get overridden
|
||||||
|
|
||||||
|
lda VARNAM+0
|
||||||
|
pha
|
||||||
|
lda VARNAM+1
|
||||||
|
pha
|
||||||
|
|
||||||
|
// Evaluate the expression
|
||||||
|
|
||||||
|
jsr FRMEVL
|
||||||
|
|
||||||
|
// Restore VARNAM
|
||||||
|
|
||||||
|
pla
|
||||||
|
sta VARNAM+1
|
||||||
|
pla
|
||||||
|
sta VARNAM+0
|
||||||
|
|
||||||
// Retrieve the variable address
|
// Retrieve the variable address
|
||||||
|
// XXX add support for arrays
|
||||||
|
|
||||||
jsr fetch_variable_find_addr
|
jsr fetch_variable_find_addr
|
||||||
|
|
||||||
// Determine variable type and push it to the stack
|
// Determine variable type
|
||||||
|
|
||||||
lda #$00
|
lda #$00
|
||||||
clc
|
clc
|
||||||
@@ -55,29 +72,8 @@ assign_variable:
|
|||||||
bpl !+
|
bpl !+
|
||||||
adc #$80
|
adc #$80
|
||||||
!:
|
!:
|
||||||
pha
|
|
||||||
|
|
||||||
// Push the VARPNT to the stack - it might get overridden
|
|
||||||
|
|
||||||
lda VARPNT+0
|
|
||||||
pha
|
|
||||||
lda VARPNT+1
|
|
||||||
pha
|
|
||||||
|
|
||||||
// Evaluate the expression
|
|
||||||
|
|
||||||
jsr FRMEVL
|
|
||||||
|
|
||||||
// Restore VARPNT
|
|
||||||
|
|
||||||
pla
|
|
||||||
sta VARPNT+1
|
|
||||||
pla
|
|
||||||
sta VARPNT+0
|
|
||||||
|
|
||||||
// Determine what to assign
|
// Determine what to assign
|
||||||
|
|
||||||
pla
|
|
||||||
bmi assign_string
|
bmi assign_string
|
||||||
beq assign_float
|
beq assign_float
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user