BeRo1985 / flre

FLRE - Fast Light Regular Expressions - A fast light regular expression library
GNU Lesser General Public License v2.1
94 stars 23 forks source link

micro-optimization crash #36

Closed benibela closed 7 years ago

benibela commented 7 years ago
 TFLRE.Create('^Q$', []).Test('')

=>

Program received signal SIGSEGV, Segmentation fault.
PTRPOSCHARSEARCH (P=0x0, V=36, PEND=0x0) at flre/src/FLRE.pas:3460
3460     movdqa xmm1,[rdi]
(gdb) bt
#0  PTRPOSCHARSEARCH (P=0x0, V=36, PEND=0x0) at flre/src/FLRE.pas:3460
#1  0xffffff01ffffff01 in ?? ()
#2  0x000000000044dbe7 in PTRPOSCHAR (SEARCHCHAR=36 '$', TEXT=0x0, TEXTLENGTH=0, OFFSET=0) at flre/src/FLRE.pas:3511
#3  0x0000000000478310 in SEARCHNEXTPOSSIBLESTART (this=0x7ffff7ff0450, INPUT=0x0, INPUTLENGTH=0) at flre/src/FLRE.pas:19507
#4  0x0000000000479000 in SEARCHMATCH (this=0x7ffff7ff0450, THREADLOCALSTORAGEINSTANCE=0x7ffff7f63e40, CAPTURES=0x7ffff7f9d4d0, STARTPOSITION=0, UNTILEXCLUDINGPOSITION=0, 
    UNANCHOREDSTART=false) at flre/src/FLRE.pas:19834
#5  0x000000000047bb64 in PTRTEST (this=0x7ffff7ff0450, INPUT=0x0, INPUTLENGTH=0, STARTPOSITION=0) at flre/src/FLRE.pas:20576
#6  0x000000000047c4f7 in TEST (this=0x7ffff7ff0450, INPUT=0x0, STARTPOSITION=1) at flre/src/FLRE.pas:20707
#7  0x000000000040066e in main () at project1.lpr:18
BeRo1985 commented 7 years ago

Should be also fixed at https://github.com/BeRo1985/flre/commit/5adbc01029fd7c1a2e00c2f7cb2380d26910e64d now