Browse Source

pcb_parser: fix an incorrect CHECK_MSG when parsing a dimension in a footprint.

this incorrect CHECK_MSG created a crash.
Fixes #11859
https://gitlab.com/kicad/code/kicad/issues/11859
7.0
jean-pierre charras 3 years ago
parent
commit
c8ce01ce8e
  1. 4
      pcbnew/plugins/kicad/pcb_parser.cpp

4
pcbnew/plugins/kicad/pcb_parser.cpp

@ -3321,8 +3321,10 @@ PCB_DIMENSION_BASE* PCB_PARSER::parseDIMENSION( BOARD_ITEM* aParent, bool aInFP
case T_text_frame:
{
wxCHECK_MSG( dim->Type() == PCB_DIM_LEADER_T, nullptr,
KICAD_T expected_type = aInFP ? PCB_FP_DIM_LEADER_T : PCB_DIM_LEADER_T;
wxCHECK_MSG( dim->Type() == expected_type, nullptr,
wxT( "Invalid text_frame token" ) );
PCB_DIM_LEADER* leader = static_cast<PCB_DIM_LEADER*>( dim.get() );
int textFrame = parseInt( "dim text frame mode" );

Loading…
Cancel
Save