Coder Social home page Coder Social logo

re1's People

Contributors

rsc avatar

Watchers

 avatar

re1's Issues

Instruction stream generated for Alt causes the recursive implementations to segfault

Segfault generated when the following is run:
./re "a|b" a

The following instructions are generated for the above regexp:
 0. split 3, 1
 1. any
 2. jmp 0
 3. save 0
 4. split 4, 7
 5. char a
 6. jmp 8
 7. char b
 8. save 1
 9. match

The full output:
Cat(NgStar(Dot), Paren(0, Alt(Lit(a), Lit(b))))
 0. split 3, 1
 1. any
 2. jmp 0
 3. save 0
 4. split 4, 7
 5. char a
 6. jmp 8
 7. char b
 8. save 1
 9. match
#2 a
Segmentation fault

I attached a patch that seems to fix the problem.

Original issue reported on code.google.com by [email protected] on 28 Jan 2010 at 2:45

Attachments:

Use explicit loops in addthread

The recursive writing of addthread obscures the fact that the Split instruction 
is the single reason we need a recursive thread processing order.

The switch cases in addthread in both pike.c and thompson.c all end upon tail 
calls. This should be acknowledged and maybe coded with an explicit loop.

Original issue reported on code.google.com by [email protected] on 30 May 2014 at 7:49

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.