octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #35683] regexp crash (named subexp/nested pare


From: Philipp Kutin
Subject: [Octave-bug-tracker] [bug #35683] regexp crash (named subexp/nested paren; maybe related to #29438)
Date: Fri, 09 Mar 2012 17:40:18 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:10.0.2) Gecko/20100101 Firefox/10.0.2

Follow-up Comment #2, bug #35683 (project octave):

Here are some reduced testcases:

It's still dependent on the string to be matched:

octave:1> simplepat = '(?<typestr>((char|short)s+)+)';
octave:2> s = regexp('', simplepat, 'names');
octave:3> s = regexp('unsigned', simplepat, 'names');
octave:4> s = regexp('unsigned char Impedance;', simplepat, 'names');
panic: Segmentation fault -- stopping myself...


However,

octave:1> simplepat = '(?<typestr>(chars+)+)';
octave:2> s = regexp('unsigned char Impedance;', simplepat, 'names');
# no crash

So it seems to be related to the alternative operator inside the inner group.

Finally,

octave:1> simplepat = '(?<typestr>((char|short)s+)+)';
octave:2> s = regexp('unsigned char Impedance;', simplepat)  # no 3rd 'names'
arg
panic: Segmentation fault -- stopping myself...


and


octave:1> simplepat = '(char|short)+';
octave:2> s = regexp('unsigned char Impedance;', simplepat)
s =  10
octave:3> simplepat = '((char|short)+)+';
octave:4> s = regexp('unsigned char Impedance;', simplepat)
s =  10
octave:5> simplepat = '((char|short)s+)+';
octave:6> s = regexp('unsigned char Impedance;', simplepat)
s =  10
octave:7> simplepat = '(((char|short)+)+)';
octave:8> s = regexp('unsigned char Impedance;', simplepat)
s =  10

So it also seems to have something to do with the named subexpression
mechanism.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?35683>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]