Fix issue where a useless error would be printed to the log and bad memory reads could occur when compiling a CON script with an invalid structure member passed as gamevar structure access shortcut shorthand

git-svn-id: https://svn.eduke32.com/eduke32@7323 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2019-01-30 09:36:52 +00:00
parent 1245799e6b
commit c4753af497

View file

@ -1500,11 +1500,13 @@ static void C_GetNextVarType(int32_t type)
case STRUCT_ACTORVAR:
case STRUCT_PLAYERVAR: labelNum = GetDefID(LAST_LABEL); break;
}
default:
g_errorCnt++;
C_ReportError(ERROR_NOTAMEMBER);
return;
if (labelNum == -1)
{
g_errorCnt++;
C_ReportError(ERROR_NOTAMEMBER);
return;
}
switch (id - g_structVarIDs)