From fbffb9ae1e5711bed884265783cd48dc586a6cde Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 20 May 2019 19:05:27 +0100 Subject: [PATCH] Don't put KICAD_T arrays on stack and expect them to be there when you need them. Fixes: lp:1829748 * https://bugs.launchpad.net/kicad/+bug/1829748 --- eeschema/tools/sch_edit_tool.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/eeschema/tools/sch_edit_tool.cpp b/eeschema/tools/sch_edit_tool.cpp index dd28c8d006..0b1df0a3ec 100644 --- a/eeschema/tools/sch_edit_tool.cpp +++ b/eeschema/tools/sch_edit_tool.cpp @@ -319,19 +319,19 @@ bool SCH_EDIT_TOOL::Init() } }; - KICAD_T toLabelTypes[] = { SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_TEXT_T, EOT }; + static KICAD_T toLabelTypes[] = { SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_TEXT_T, EOT }; auto toLabelCondition = E_C::Count( 1 ) && E_C::OnlyTypes( toLabelTypes ); - KICAD_T toHLableTypes[] = { SCH_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_TEXT_T, EOT }; - auto toHLabelCondition = E_C::Count( 1 ) && E_C::OnlyTypes( toHLableTypes); + static KICAD_T toHLableTypes[] = { SCH_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_TEXT_T, EOT }; + auto toHLabelCondition = E_C::Count( 1 ) && E_C::OnlyTypes( toHLableTypes ); - KICAD_T toGLableTypes[] = { SCH_LABEL_T, SCH_HIER_LABEL_T, SCH_TEXT_T, EOT }; - auto toGLabelCondition = E_C::Count( 1 ) && E_C::OnlyTypes( toGLableTypes); + static KICAD_T toGLableTypes[] = { SCH_LABEL_T, SCH_HIER_LABEL_T, SCH_TEXT_T, EOT }; + auto toGLabelCondition = E_C::Count( 1 ) && E_C::OnlyTypes( toGLableTypes ); - KICAD_T toTextTypes[] = { SCH_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, EOT }; - auto toTextlCondition = E_C::Count( 1 ) && E_C::OnlyTypes( toTextTypes); + static KICAD_T toTextTypes[] = { SCH_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, EOT }; + auto toTextlCondition = E_C::Count( 1 ) && E_C::OnlyTypes( toTextTypes ); - KICAD_T entryTypes[] = { SCH_BUS_WIRE_ENTRY_T, SCH_BUS_BUS_ENTRY_T, EOT }; + static KICAD_T entryTypes[] = { SCH_BUS_WIRE_ENTRY_T, SCH_BUS_BUS_ENTRY_T, EOT }; auto entryCondition = E_C::MoreThan( 0 ) && E_C::OnlyTypes( entryTypes ); auto singleComponentCondition = E_C::Count( 1 ) && E_C::OnlyType( SCH_COMPONENT_T );