prevent `lda @y` or `lda @x` (which is accepted by the parser) from crashing.

This commit is contained in:
Kelvin Sherlock 2016-02-23 21:12:07 -05:00
parent 4cc8c97be5
commit 752bd31a3f
2 changed files with 3 additions and 1 deletions

View File

@ -1109,7 +1109,8 @@ evaluateExpressionInternally(expressionType *expression, bool isTopLevel, fixupK
evaluateExpression(expressionType *expression, fixupKindType kindOfFixup)
{
valueType *result;
nullEvaluate(expression);
expressionFailed = FALSE;
referencesToNote[currentOperandNumber] = NULL;
result = evaluateExpressionInternally(expression, TRUE, kindOfFixup,

View File

@ -299,6 +299,7 @@ evaluateOperand(operandType *operand)
case Y_INDEXED_OPND:
result = evaluateExpression(operand->theOperand.expressionUnion,
performingFixups ? NO_FIXUP : OPERAND_FIXUP);
nullEvaluate(result);
if (operand->kindOfOperand != EXPRESSION_OPND) {
if (result->addressMode != EXPRESSION_OPND) {
error(BAD_ADDRESS_MODE_ERROR);