Closed kanielc closed 10 years ago
I get an iterator out of range error when I run Flint++
on itself. Can you try to replicate this? I'll have a debug now and see if I can find the problem
Specifically the line of stl code which generates the error shows this as the culprit.
_DEBUG_ERROR("string iterator not dereferencable");
Just ran it locally (both the branch and master), didn't get any errors.
What compiler do you have? I'm on GCC 4.8.2
MSVC++ '13
I believe it's coming from the use of &*pc
Interesting... I think it's a compiler thing, because that should be valid. I'll look into it more (maybe later today as I have an appointment).
I'm getting to the char in the iterator and then just getting a direct pointer to it.
OK, I added a bit of a safety check elsewhere in a new PR, but I'll try at this one too later.
So instead of chomping the string we're processing, instead use an iterator into the data (since it's always a substring of input).
This avoids a bunch of string re-allocations. The best part is that the performance is now much better.
Run time from the original test run (a few commits ago): Flint++ - 0m0.987s Present run time after the iterator and file changes: real 0m0.281s It's actually faster now than Facebook's C++ version :)
By the way, this is the profile of the project tested on: Lint Summary: 642 files Errors: 91 Warnings: 397 Advice: 268
@L2Program I had to comment out some assert calls because I no longer had access to
.size()
from the iterator. I'll leave it up to you to decide what we should do with them.