leaningtech-dev team mailing list archive
-
leaningtech-dev team
-
Mailing list archive
-
Message #00371
[Bug 1644017] Re: Using std::map in functions the second time crashes
Hello,
I am not sure that I properly reproduced your bug. From my preliminary
analysis it would seem that the only problem is that Juliar_core::hide
is not defined. I would suggest that you use the -cheerp-pretty-code
command line option to generate more readable and debuggable code.
--
You received this bug notification because you are a member of
Leaningtech Team, which is subscribed to Cheerp.
https://bugs.launchpad.net/bugs/1644017
Title:
Using std::map in functions the second time crashes
Status in Cheerp:
New
Bug description:
I am having a very large problem.
I have a map which is identified with "std::map<string,string (*)(string,vector<string>)>".
The map contains a name of the function that maps to the actual function.
I have to make several calls to this map. The map is in global scope.
One of my functions contains an std::map<string,string>. The map
executes correctly if ran the first time, however, the second time it
executes a function it errors out: "Uncaught TypeError: Cannot read
property 'a0' of undefined" . I manage to find the cause of the
problem and it seems to be including any type of std::map in a
function. If I remove the std::map it executes fully and correctly. If
I add it to any other function that is also has a pointer from
"std::map<string,string (*)(string,vector<string>)>". it gives me an
error on second execution. So for now, I am using vectors which seem
to work. However, I would really love to use std::map<string,string>
for several of my functions. Again, it executes once, but fails to
execute second time. Perhaps this is due to Cheerp Preprocesser
optimizing the std::map that executes first time and then after it
completes the execution, the second time, it somehow tries to
overwrite that object?
I am not sure, but it would be great if it gets fixed.
To manage notifications about this bug go to:
https://bugs.launchpad.net/cheerp/+bug/1644017/+subscriptions
References