You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you look at generated code for valid_*.ksy tests you will see that exceptions are created using temporary values from getters of just constants. The program will crash if you try to get the result from the exception.
Some examples:
// expr: _ == 1// expr: _ < -190 or _ > -190voidvalid_fail_expr_t::_read() {
m_foo = m__io->read_u1();
{
uint8_t _ = foo();
if (!(_ == 1)) {
// reference to temporary returned by foo()throw kaitai::validation_expr_error<uint8_t>(foo(), _io(), std::string("/seq/0"));
}
}
m_bar = m__io->read_s2le();
{
int16_t _ = bar();
if (!( ((_ < -190) || (_ > -190)) )) {
// reference to temporary returned by bar()throw kaitai::validation_expr_error<int16_t>(bar(), _io(), std::string("/seq/1"));
}
}
}
// max: 12voidvalid_fail_max_int_t::_read() {
m_foo = m__io->read_u1();
if (!(foo() <= 12)) {
// reference to constant 12throw kaitai::validation_greater_than_error<uint8_t>(12, foo(), _io(), std::string("/seq/0"));
}
}
// min: 123voidvalid_fail_min_int_t::_read() {
m_foo = m__io->read_u1();
if (!(foo() >= 123)) {
// reference to constant 123throw kaitai::validation_less_than_error<uint8_t>(123, foo(), _io(), std::string("/seq/0"));
}
}
The text was updated successfully, but these errors were encountered:
If you look at generated code for
valid_*.ksy
tests you will see that exceptions are created using temporary values from getters of just constants. The program will crash if you try to get the result from the exception.Some examples:
The text was updated successfully, but these errors were encountered: