Menu

#80 Assertion failure in QM 2.3.2

QM3
closed
nobody
QM 2.3.2 (1)
1
2018-05-04
2014-01-03
Anonymous
No

Assertion failed in QM version 2.3.2 module codec:346. I was adding a guard at the time. The model containing this guard will crash QM consistently. This is a QP Nano model that is built as an assembly of five AO components.

Discussion

  • Quantum Leaps

    Quantum Leaps - 2014-01-03

    This assertion fires when you have more than 15 levels of indentation in your code. This is indicative of a very convoluted design. (Actually, the 15-levels of IF-ELSE is the number Jack Ganssle used in one of his articles to describe a proverbial spaghetti code.) This type of spaghetti code is exactly what state machines are supposed to eliminate.

    Most likely you are doing something like a very long chain of choice-segments (nested guard conditions). This is typically indicative of not using enough states, but instead of making all decisions in the guard conditions.

    --MMS

     

    Last edit: Quantum Leaps 2014-01-03
  • Quantum Leaps

    Quantum Leaps - 2014-01-08
    • status: open --> closed
     
  • Quantum Leaps

    Quantum Leaps - 2014-01-08

    This problem should be fixed in QM 3.x. This version checks the depth of nesting of choice segments and reports a code-generation error when the depth exceeds 10 levels. Consequently, the indentation of the code cannot exceed 15 levels, whereas up to 3 additional levels are needed for indenting actions in the generated state-handler function.
    --MMS

     

Anonymous
Anonymous

Add attachments
Cancel