result->parenCount = pState->parenCount;
result->parenCount = (REint32)pState->parenCount;
static REMatchState *initMatch(REGlobalData *gData, REState *pState,                            const REchar *text, REint32 length, int globalMultiline){    REMatchState *result;    REint32 j;    if (!backTrackStack) {        maxBackTrack = INITIAL_BACKTRACK;        backTrackStack = (REBackTrackData *)malloc(sizeof(REBackTrackData)                                                             * maxBackTrack);        if (!backTrackStack) {            reportRegExpError(&gData->error, RE_OUT_OF_MEMORY);            return NULL;        }    }    if (!stateStack) {        maxStateStack = INITIAL_STATESTACK;        stateStack = (REProgState *)malloc(sizeof(REProgState)                                                          * maxStateStack);        if (!stateStack) {            reportRegExpError(&gData->error, RE_OUT_OF_MEMORY);            return NULL;        }    }    result = (REMatchState *)malloc(sizeof(REMatchState)                         + (pState->parenCount * sizeof(RECapture)));    if (!result) {        reportRegExpError(&gData->error, RE_OUT_OF_MEMORY);        return NULL;    }    result->parenCount = pState->parenCount;    for (j = 0; j < result->parenCount; j++)        result->parens[j].index = -1;    result->startIndex = 0;    result->endIndex = 0;    pState->error = RE_NO_ERROR;        gData->regexp = pState;    gData->input = text;    gData->length = length;    gData->error = RE_NO_ERROR;    gData->lastParen = 0;    gData->globalMultiline = globalMultiline;        backTrackStackTop = 0;    stateStackTop = 0;    return result;}