pzembrod / cc64

cc64 is a small-C compiler written in Forth, hosted on the Commodore C64, Plus4 and C16 with 64k, and on the Commander X16. It is targeting the 6502 CPU.
Other
96 stars 6 forks source link

drop-std-argument has unmatched .pla #1

Closed pzembrod closed 2 years ago

pzembrod commented 4 years ago

In | : std-arguments ( -- ) assign put-std-argument BEGIN ascii , #char# comes? WHILE assign drop-std-argument REPEAT ;

the intended behaviour was most likely that only the first argument to a stdfunction gets used, any further arguments should be dropped. However, there seems to be a .pha missing somewhere (probably after the WHILE) to match the .pla in drop-std-argument:

| : put-std-argument ( obj -- ) value non-constant 2drop ;

| : drop-std-argument ( obj -- ) value non-constant 2drop .pla ;

pzembrod commented 2 years ago

drop-std-argument (renamed to drop-fastcall-argument) was discarded in v0.10 - no more accepting more than 1 argument in fastcall invocations, thus no longer the need to drop arguments. So this issue is closed as obsolete. However, just for argument's sake: the code was likely correct - the .pha that matches the .pla in drop-std-argument is most likely called in require-accu that must be called at some time during the evaluation of an expression and making it non-constant.