[pcre-dev] doubtful code in compile_branch()

Top Page
Delete this message
Author: Issaana
Date:  
To: Pcre-dev
Subject: [pcre-dev] doubtful code in compile_branch()
I'm sorry for broken English.

I found the doubtful code in compile_branch().

    if (code > cd->start_workspace + COMPILE_WORK_SIZE) /* Check for 
overrun */


Is it too late when an overrun happened? Because the address for return
from the function in stack may be destroyed.

Therefore I think that a code such as follow is better.

    if (code > cd-start_workspace + COMPILE_WORK_SIZE - X_SIZE) /* Check 
for overrun */


X_SIZE is the max number of bytes that is used in one loop. Perhaps it
is about 80-90 bytes when a pattern is [\H] in UTF8 mode.

Is it right?

Thanks,
Issaana