-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Runtime error when reading INT Signal as an Integer - Interpreted as Double #130
Comments
Can you provide a more precise example? Show me your source code or something. |
The entire code is too long, but this is the main part. The ISignal* was gotten from an IMessage->Signals().
Runtime error with std::get<0>, correct result with std::get<1> (double). _sig_def->ExtendedValueType() returns 1 for FLOAT, when the .dbc file says the Attribute is an INT. |
I checked the grammar parser, and it seems like this is due to an error in the grammar (here). The marked line says:
This line will make the grammar parser first try to parse the value as an Can you fix this in your local |
Yes, I can confirm this fixes it. Thanks so much! |
The tests are failing, you should use the dirty fix with care. |
My .dbc file says this:
In code, I get the ISignal, and ask for its -> AttributeValues(), iterating over them. If I try to do
std::get<0>(a.Value())
(fetch the Attribute value as an INTEGER, because the value_t the .Value() method returns is an std::variant<int64_t, double, std::string>), my program crashes. Turns out that the attribute was parsed as a FLOAT, and the program only works if I dostd::get<1>(a.Value())
, and try to read it as a real number.The text was updated successfully, but these errors were encountered: