Coder Social home page Coder Social logo

Comments (1)

tcbrindle avatar tcbrindle commented on June 11, 2024

In the multipass version of flatten_adaptor, we stop iterating when the outer cursor reaches the end of the outer sequence. However, when we get there, we don't reset the inner cursor, which is left pointing to wherever it previously pointed to. This means that a cursor which has iterated through to the end winds up not equal to the cursor returned from last() (which contains a default-constructed inner cursor).

This showed up when using to() because it uses (adapted) iterators which, of course, want to stop iterating when iter == last. Since that equality never happened, we end up trying to read past the end. The good news is we got a bounds violation runtime error rather than UB -- the system works!

Anyway, the solution is to make sure we reset the inner cursor when we reach the end in multipass flatten_adaptor. PR incoming...

from flux.

Related Issues (20)

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.