Cleanup the RPN evaluator somewhat

Make the bool field an actual bool
Rename `iReloc` to a more exact `isKnown` (as was already pointed out by some
comments)
Make the value of `BANK(symbol)` consistent when the argument is invalid
This commit is contained in:
ISSOtm
2020-01-20 14:04:14 +01:00
parent 0a04904b75
commit cc59730c5b
4 changed files with 44 additions and 46 deletions

View File

@@ -766,7 +766,7 @@ void out_RelByte(struct Expression *expr)
{
checkcodesection();
checksectionoverflow(1);
if (rpn_isReloc(expr)) {
if (!rpn_isKnown(expr)) {
pCurrentSection->tData[nPC] = 0;
createpatch(PATCHTYPE_BYTE, expr);
pCurrentSection->nPC++;
@@ -801,7 +801,7 @@ void out_RelWord(struct Expression *expr)
{
checkcodesection();
checksectionoverflow(2);
if (rpn_isReloc(expr)) {
if (!rpn_isKnown(expr)) {
pCurrentSection->tData[nPC] = 0;
pCurrentSection->tData[nPC + 1] = 0;
createpatch(PATCHTYPE_WORD, expr);
@@ -838,7 +838,7 @@ void out_RelLong(struct Expression *expr)
{
checkcodesection();
checksectionoverflow(4);
if (rpn_isReloc(expr)) {
if (!rpn_isKnown(expr)) {
pCurrentSection->tData[nPC] = 0;
pCurrentSection->tData[nPC + 1] = 0;
pCurrentSection->tData[nPC + 2] = 0;