Fix compilation of malformed statements using array style notation.

git-svn-id: https://svn.eduke32.com/eduke32@5575 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2016-01-21 19:35:14 +00:00
parent c4193d933b
commit 806413e887

View file

@ -2038,13 +2038,16 @@ static int32_t C_GetNextValue(int32_t type)
return 0; // literal value
}
static int32_t C_GetStructureIndexes(int32_t labelsonly, hashtable_t *table)
static int32_t C_GetStructureIndexes(int32_t const labelsonly, hashtable_t const * const table)
{
while ((*textptr != '['))
textptr++;
C_SkipComments();
if (*textptr == '[')
textptr++;
if (EDUKE32_PREDICT_FALSE(*textptr++ != '['))
{
g_numCompilerErrors++;
C_ReportError(ERROR_SYNTAXERROR);
return -1;
}
C_SkipComments();
@ -2060,24 +2063,19 @@ static int32_t C_GetStructureIndexes(int32_t labelsonly, hashtable_t *table)
g_labelsOnly = 0;
}
// now get name of .xxx
while (*textptr != '.')
{
if (*textptr == 0xa || !*textptr)
break;
textptr++;
}
if (EDUKE32_PREDICT_FALSE(*textptr != '.'))
C_SkipComments();
// now get name of .xxx
if (EDUKE32_PREDICT_FALSE(*textptr++ != '.'))
{
g_numCompilerErrors++;
C_ReportError(ERROR_SYNTAXERROR);
return -1;
}
textptr++;
if (!table)
return 0;