So I am investigating a bug in a project here at work. This perticular problem
having to do with parsing using IT++.
I was trying to parse a sequence of type itpp::Array< itpp::Vec< int > >
having the form
"{ [1 2 3] [4 5 6] [7 8 9] }"
and it seems like having an extra whitespace character just before the last
"}" will cause the array to end up as
{[1 2 3] [4 5 6] [7 8 9] [0]}
Not quite what I expected, but not the most disastrous bug I found...
Now, I set up an independent dummy project to test this out ran some tests,
only to find out that I wound up in an infinite loop in the Array::operator>>
method... And looking at the code, I can see how it happens: when the next
character is not a comma, the istream is putback, and then re-read at the same
character, over and over again, causing the loop!
Am I onto something disastrous here or am I missing something? Seeing that it
is late on a friday afternoon I am starting to suspect that last option...
Heh, late in the afternoon indeed. 1 minute after posting I realized that my
type I was trying to parse to wasn't Array<Vec<int>> at all, but Array<int>...
Move along, nothing to see here...! :D
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So I am investigating a bug in a project here at work. This perticular problem
having to do with parsing using IT++.
I was trying to parse a sequence of type itpp::Array< itpp::Vec< int > >
having the form
and it seems like having an extra whitespace character just before the last
"}" will cause the array to end up as
Not quite what I expected, but not the most disastrous bug I found...
Now, I set up an independent dummy project to test this out ran some tests,
only to find out that I wound up in an infinite loop in the Array::operator>>
method... And looking at the code, I can see how it happens: when the next
character is not a comma, the istream is putback, and then re-read at the same
character, over and over again, causing the loop!
Am I onto something disastrous here or am I missing something? Seeing that it
is late on a friday afternoon I am starting to suspect that last option...
my small test program:
Heh, late in the afternoon indeed. 1 minute after posting I realized that my
type I was trying to parse to wasn't Array<Vec<int>> at all, but Array<int>...
Move along, nothing to see here...! :D