Fix missed error on invalid index register (#24)

This commit is contained in:
Tillmann Karras 2022-08-31 07:22:59 +01:00 committed by fincs
parent 5cf6319a05
commit 6e0063ea00

View File

@ -716,7 +716,7 @@ static int parseReg(char* pos, int& outReg, int& outSw, int* idxType = NULL)
char* idxRegName = trim_whitespace(offPos); char* idxRegName = trim_whitespace(offPos);
offPos = trim_whitespace(plusPos); offPos = trim_whitespace(plusPos);
*idxType = convertIdxRegName(idxRegName); *idxType = convertIdxRegName(idxRegName);
if (*idxType < 0) if (!*idxType)
return throwError("invalid index register: %s\n", idxRegName); return throwError("invalid index register: %s\n", idxRegName);
} while (0); } while (0);