Giter VIP home page Giter VIP logo

Comments (5)

momoko-h avatar momoko-h commented on July 22, 2024

EDT.cc line 29 simply initializes a vector from an initializer_list. Even if the list is empty this shouldn't be a problem. Could you try three things?

  1. Does it make a difference if you change line 29 to columns{ columnsList.begin(), columnsList.end() },
  2. Does the following program run?
#include <vector>
#include <initializer_list>
using namespace std;

int main()
{
    initializer_list<unsigned short> il{ 400, 160 };
    vector<unsigned short> v{ il };
    return v[1];
}

  1. Does the mingw build work?

from ja2-stracciatella.

ShishkinP avatar ShishkinP commented on July 22, 2024
  1. Does it make a difference if you change line 29 to columns{ columnsList.begin(), columnsList.end() },

No - same crashing occurs.

  1. Does the following program run?

Yes - returns 160.

Does the mingw build work?

Unfortunately, I couldn't even make successful mingw build so far. Having the same problem: #1917 (comment)
Update: Yes, it does - no crashing.

from ja2-stracciatella.

momoko-h avatar momoko-h commented on July 22, 2024

Thanks. So from what I read initializer_list are quite tricky and a bit of a nightmare for STL implementors.

Do you have the crash caught inside a debugger? If yes, could you please take a look if the lists were properly constructed in EDTFile::EDTFilesTable? If yes, what is the last frame in your callstack where the list is still ok?

I'm grasping at straws here but if EDTFilesTable is correct, could you trying changing lines 27 and 78 in EDT.cc ?
Replace IEDT::column_list columnsList with IEDT::column_list const& columnsList in both lines.

If that also doesn't work I think the best option left is to change the type of IEDT::column_list to vector<uint16_t>.

from ja2-stracciatella.

ShishkinP avatar ShishkinP commented on July 22, 2024

If yes, what is the last frame in your callstack where the list is still ok?

It seems to be ok all the way. "Unable to read memory" is expected since it's not supposed to be initialized before the exception, right? This area is above my competence level, so sorry for the pic dump:

frame-1
frame-2
frame-3
frame-4
frame-5

Replace IEDT::column_list columnsList with IEDT::column_list const& columnsList in both lines.

No luck.

change the type of IEDT::column_list to vector<uint16_t>

error

from ja2-stracciatella.

momoko-h avatar momoko-h commented on July 22, 2024

Ok, that's really lame. If MSVC can't handle using initializer_list in this way it should at least fail to compile instead of producing a broken executable. I'll post a draft PR later.

from ja2-stracciatella.

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.