MATLAB: Do I receive a stack trace and the error “Code generation failed –>Stateflow Assertion Error” when I build the model with Stateflow 6.2 (R14SP2) charts

chart;codefailedgenerationsegvsendstateflow

I am building a model which has Stateflow charts and I receive the following stack trace:
[0] sf.dll:_assertion_failed(0x0fe85640 "false", 0x0fee9e14 "B:/matlab/toolbox/stateflow/src/..", 1729, 0) + 56 bytes
[1] sf.dll:struct CG_Obj_struct * __cdecl create_cg_nodes_from_ast(struct CG_Cfg_struct *,struct AstNode *,unsigned int)(0x12712768, 0x0fbf7d38, 43, 0x12712768) + 3896 bytes
[2] sf.dll:struct CG_Obj_struct * __cdecl create_cg_nodes_from_ast(struct CG_Cfg_struct *,struct AstNode *,unsigned int)(0x12712768, 0x12717808, 43, 0x12712768) + 2967 bytes
[3] sf.dll:struct CG_Obj_struct * __cdecl create_internal_function_call(struct CG_Cfg_struct *,struct AstNode *,unsigned int,struct CG_Const_struct *)(0x12712768, 43, 0x12539cf8, 0x0feea3d8 "CV_TRANSITION_EVAL") + 140 bytes
[4] sf.dll:struct CG_Obj_struct * __cdecl create_cg_nodes_from_ast(struct CG_Cfg_struct *,struct AstNode *,unsigned int)(0x12712768, 0x0fbf7cc0, 43, 0x12712768) + 3084 bytes
<snip>
I also receive the following error:
Code generation failed -->Stateflow Assertion Error :(SLSF Diagnostic)false

Best Answer

This bug has been fixed in Release 2006a (R2006a). For previous product releases, read below for any possible workarounds:
There is a bug in Stateflow 6.2 (R14SP2) in the way that a proper error is not generated when the "send()" keyword is used incorrectly. This model has an error that is not caught by the parser and therefore causes downstream errors.
This occurs if you use the "send()" keyword in its guarding condition, as in the following example:
[send(DL_SYNCHRONIZED,UL_SYNC)]
The keyword send() is an event broadcast action. It can appear only in a transition's actions and not in the guarding condition.
To work around this issue, change this transition to read:
{send(DL_SYNCHRONIZED,UL_SYNC)}