From 327cca9de5969964b31f4ef1ff6e09c8bfe4f641 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 25 May 2025 13:30:57 +0100 Subject: [PATCH] Coverity fixes. --- 3d-viewer/3d_cache/3d_cache.cpp | 6 ++-- .../3d_rendering/raytracing/create_scene.cpp | 2 +- common/embedded_files.cpp | 35 ++++++++----------- eeschema/dialogs/dialog_sim_model.cpp | 7 ++-- eeschema/eeschema_jobs_handler.cpp | 8 ++++- eeschema/files-io.cpp | 2 +- .../netlist_exporter_spice.cpp | 2 +- eeschema/sch_commit.cpp | 2 ++ eeschema/sch_edit_frame.cpp | 2 +- eeschema/sch_field.cpp | 2 +- eeschema/sch_pin.cpp | 3 +- eeschema/sch_symbol.cpp | 2 +- eeschema/sim/sim_lib_mgr.cpp | 2 +- eeschema/sim/sim_lib_mgr.h | 6 ++-- eeschema/sim/sim_model.cpp | 22 ++++++------ eeschema/sim/sim_model_ibis.cpp | 2 +- eeschema/sim/simulator_frame_ui.cpp | 2 +- eeschema/tools/ee_grid_helper.cpp | 2 +- eeschema/tools/sch_editor_control.cpp | 2 +- kicad/dialogs/panel_jobset.cpp | 3 +- pcbnew/board_commit.cpp | 2 +- pcbnew/dialogs/dialog_drc.cpp | 2 +- pcbnew/dialogs/dialog_footprint_checker.cpp | 2 +- pcbnew/exporters/export_idf.cpp | 2 +- pcbnew/router/router_tool.cpp | 1 + 25 files changed, 66 insertions(+), 57 deletions(-) diff --git a/3d-viewer/3d_cache/3d_cache.cpp b/3d-viewer/3d_cache/3d_cache.cpp index a59c10a4a6..377588bbc3 100644 --- a/3d-viewer/3d_cache/3d_cache.cpp +++ b/3d-viewer/3d_cache/3d_cache.cpp @@ -147,7 +147,7 @@ SCENEGRAPH* S3D_CACHE::load( const wxString& aModelFile, const wxString& aBasePa if( aCachePtr ) *aCachePtr = nullptr; - wxString full3Dpath = m_FNResolver->ResolvePath( aModelFile, aBasePath, aEmbeddedFilesStack ); + wxString full3Dpath = m_FNResolver->ResolvePath( aModelFile, aBasePath, std::move( aEmbeddedFilesStack ) ); if( full3Dpath.empty() ) { @@ -215,7 +215,7 @@ SCENEGRAPH* S3D_CACHE::load( const wxString& aModelFile, const wxString& aBasePa SCENEGRAPH* S3D_CACHE::Load( const wxString& aModelFile, const wxString& aBasePath, std::vector aEmbeddedFilesStack ) { - return load( aModelFile, aBasePath, nullptr, aEmbeddedFilesStack ); + return load( aModelFile, aBasePath, nullptr, std::move( aEmbeddedFilesStack ) ); } @@ -552,7 +552,7 @@ S3DMODEL* S3D_CACHE::GetModel( const wxString& aModelFileName, const wxString& a std::vector aEmbeddedFilesStack ) { S3D_CACHE_ENTRY* cp = nullptr; - SCENEGRAPH* sp = load( aModelFileName, aBasePath, &cp, aEmbeddedFilesStack ); + SCENEGRAPH* sp = load( aModelFileName, aBasePath, &cp, std::move( aEmbeddedFilesStack ) ); if( !sp ) return nullptr; diff --git a/3d-viewer/3d_rendering/raytracing/create_scene.cpp b/3d-viewer/3d_rendering/raytracing/create_scene.cpp index 04bc83c677..afa7e2d68a 100644 --- a/3d-viewer/3d_rendering/raytracing/create_scene.cpp +++ b/3d-viewer/3d_rendering/raytracing/create_scene.cpp @@ -1296,7 +1296,7 @@ void RENDER_3D_RAYTRACE_BASE::load3DModels( CONTAINER_3D& aDstContainer, embeddedFilesStack.push_back( m_boardAdapter.GetBoard()->GetEmbeddedFiles() ); const S3DMODEL* modelPtr = cacheMgr->GetModel( model.m_Filename, footprintBasePath, - embeddedFilesStack ); + std::move( embeddedFilesStack ) ); // only add it if the return is not NULL. if( modelPtr ) diff --git a/common/embedded_files.cpp b/common/embedded_files.cpp index 92ef040517..6ab3fb1cd1 100644 --- a/common/embedded_files.cpp +++ b/common/embedded_files.cpp @@ -371,8 +371,10 @@ void EMBEDDED_FILES_PARSER::ParseEmbedded( EMBEDDED_FILES* aFiles ) switch( token ) { - case T_checksum: + if( !file ) + Expecting( T_name ); + NeedSYMBOLorNUMBER(); if( !IsSymbol( token ) ) @@ -383,6 +385,9 @@ void EMBEDDED_FILES_PARSER::ParseEmbedded( EMBEDDED_FILES* aFiles ) break; case T_data: + if( !file ) + Expecting( T_name); + try { NeedBAR(); @@ -419,7 +424,6 @@ void EMBEDDED_FILES_PARSER::ParseEmbedded( EMBEDDED_FILES* aFiles ) break; case T_name: - if( file ) { wxLogTrace( wxT( "KICAD_EMBED" ), @@ -435,30 +439,21 @@ void EMBEDDED_FILES_PARSER::ParseEmbedded( EMBEDDED_FILES* aFiles ) break; case T_type: + if( !file ) + Expecting( T_name ); token = NextTok(); switch( token ) { - case T_datasheet: - file->type = EMBEDDED_FILES::EMBEDDED_FILE::FILE_TYPE::DATASHEET; - break; - case T_font: - file->type = EMBEDDED_FILES::EMBEDDED_FILE::FILE_TYPE::FONT; - break; - case T_model: - file->type = EMBEDDED_FILES::EMBEDDED_FILE::FILE_TYPE::MODEL; - break; - case T_worksheet: - file->type = EMBEDDED_FILES::EMBEDDED_FILE::FILE_TYPE::WORKSHEET; - break; - case T_other: - file->type = EMBEDDED_FILES::EMBEDDED_FILE::FILE_TYPE::OTHER; - break; - default: - Expecting( "datasheet, font, model, worksheet or other" ); - break; + case T_datasheet: file->type = EMBEDDED_FILES::EMBEDDED_FILE::FILE_TYPE::DATASHEET; break; + case T_font: file->type = EMBEDDED_FILES::EMBEDDED_FILE::FILE_TYPE::FONT; break; + case T_model: file->type = EMBEDDED_FILES::EMBEDDED_FILE::FILE_TYPE::MODEL; break; + case T_worksheet: file->type = EMBEDDED_FILES::EMBEDDED_FILE::FILE_TYPE::WORKSHEET; break; + case T_other: file->type = EMBEDDED_FILES::EMBEDDED_FILE::FILE_TYPE::OTHER; break; + default: Expecting( "datasheet, font, model, worksheet or other" ); break; } + NeedRIGHT(); break; diff --git a/eeschema/dialogs/dialog_sim_model.cpp b/eeschema/dialogs/dialog_sim_model.cpp index eda7d3faa1..d675117e6c 100644 --- a/eeschema/dialogs/dialog_sim_model.cpp +++ b/eeschema/dialogs/dialog_sim_model.cpp @@ -343,8 +343,11 @@ bool DIALOG_SIM_MODEL::TransferDataToWindow() template bool DIALOG_SIM_MODEL::TransferDataFromWindow() { - m_pinAssignmentsGrid->CommitPendingChanges(); - m_paramGrid->GetGrid()->CommitChangesFromEditor(); + if( !m_pinAssignmentsGrid->CommitPendingChanges() ) + return false; + + if( !m_paramGrid->GetGrid()->CommitChangesFromEditor() ) + return false; if( !DIALOG_SIM_MODEL_BASE::TransferDataFromWindow() ) return false; diff --git a/eeschema/eeschema_jobs_handler.cpp b/eeschema/eeschema_jobs_handler.cpp index f096600267..3cc97f1cef 100644 --- a/eeschema/eeschema_jobs_handler.cpp +++ b/eeschema/eeschema_jobs_handler.cpp @@ -973,7 +973,13 @@ int EESCHEMA_JOBS_HANDLER::JobSymExportSvg( JOB* aJob ) if( !svgJob->m_outputDirectory.IsEmpty() && !wxDir::Exists( svgJob->m_outputDirectory ) ) { - wxFileName::Mkdir( svgJob->m_outputDirectory ); + if( !wxFileName::Mkdir( svgJob->m_outputDirectory ) ) + { + m_reporter->Report( wxString::Format( _( "Unable to create output directory '%s'." ) + wxS( "\n" ), + svgJob->m_outputDirectory ), + RPT_SEVERITY_ERROR ); + return CLI::EXIT_CODES::ERR_UNKNOWN; + } } SCH_RENDER_SETTINGS renderSettings; diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index 64da930107..0cf47e1b09 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -1026,7 +1026,7 @@ bool SCH_EDIT_FRAME::SaveProject( bool aSaveAs ) // File doesn't exist yet; true if we just imported something updateFileHistory = true; } - else if( screens.GetFirst()->GetFileFormatVersionAtLoad() < SEXPR_SCHEMATIC_FILE_VERSION ) + else if( screens.GetFirst() && screens.GetFirst()->GetFileFormatVersionAtLoad() < SEXPR_SCHEMATIC_FILE_VERSION ) { // Allow the user to save un-edited files in new format } diff --git a/eeschema/netlist_exporters/netlist_exporter_spice.cpp b/eeschema/netlist_exporters/netlist_exporter_spice.cpp index c29608a9df..bd5e818caf 100644 --- a/eeschema/netlist_exporters/netlist_exporter_spice.cpp +++ b/eeschema/netlist_exporters/netlist_exporter_spice.cpp @@ -67,7 +67,7 @@ NETLIST_EXPORTER_SPICE::NETLIST_EXPORTER_SPICE( SCHEMATIC* aSchematic ) : { std::vector embeddedFilesStack; embeddedFilesStack.push_back( aSchematic->GetEmbeddedFiles() ); - m_libMgr.SetFilesStack( embeddedFilesStack ); + m_libMgr.SetFilesStack( std::move( embeddedFilesStack ) ); } diff --git a/eeschema/sch_commit.cpp b/eeschema/sch_commit.cpp index dd33e52abe..8728f85a21 100644 --- a/eeschema/sch_commit.cpp +++ b/eeschema/sch_commit.cpp @@ -237,6 +237,8 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags ) SCH_ITEM* schItem = dynamic_cast( ent.m_item ); int changeType = ent.m_type & CHT_TYPE; + wxCHECK2( schItem, continue ); + if( changeType == CHT_REMOVE && schItem->GetParentGroup() ) Modify( schItem->GetParentGroup()->AsEdaItem() ); } diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 906b54e4b5..4cf0bffd67 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -1629,7 +1629,7 @@ void SCH_EDIT_FRAME::RefreshOperatingPointDisplay() embeddedFilesStack.push_back( m_schematic->GetEmbeddedFiles() ); embeddedFilesStack.push_back( symbol->GetEmbeddedFiles() ); - simLibMgr.SetFilesStack( embeddedFilesStack ); + simLibMgr.SetFilesStack( std::move( embeddedFilesStack ) ); SIM_MODEL& model = simLibMgr.CreateModel( &GetCurrentSheet(), *symbol, true, 0, devnull ).model; diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index c24c029dbc..8d8762685d 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -748,7 +748,7 @@ void SCH_FIELD::OnScintillaCharAdded( SCINTILLA_TRICKS* aScintillaTricks, embeddedFilesStack.push_back( schematic->GetEmbeddedFiles() ); embeddedFilesStack.push_back( symbol->GetEmbeddedFiles() ); - mgr.SetFilesStack( embeddedFilesStack ); + mgr.SetFilesStack( std::move( embeddedFilesStack ) ); SIM_MODEL& model = mgr.CreateModel( &sheet, *symbol, true, 0, devnull ).model; diff --git a/eeschema/sch_pin.cpp b/eeschema/sch_pin.cpp index 3c84742753..94962207b4 100644 --- a/eeschema/sch_pin.cpp +++ b/eeschema/sch_pin.cpp @@ -1206,11 +1206,10 @@ void SCH_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorMessageTextFromValue( GetPosition().x, true ) ); aList.emplace_back( _( "Pos Y" ), aFrame->MessageTextFromValue( GetPosition().y, true ) ); } - else + else if( SCH_SYMBOL* schsymbol = dynamic_cast( symbol ) ) { SCH_EDIT_FRAME* schframe = dynamic_cast( aFrame ); SCH_SHEET_PATH* currentSheet = schframe ? &schframe->GetCurrentSheet() : nullptr; - SCH_SYMBOL* schsymbol = dynamic_cast( symbol ); // Don't use GetShownText(); we want to see the variable references here aList.emplace_back( symbol->GetRef( currentSheet ), diff --git a/eeschema/sch_symbol.cpp b/eeschema/sch_symbol.cpp index 082e997cf4..d7f77b8b6f 100644 --- a/eeschema/sch_symbol.cpp +++ b/eeschema/sch_symbol.cpp @@ -1319,7 +1319,7 @@ bool SCH_SYMBOL::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, i if( m_part ) embeddedFilesStack.push_back( m_part->GetEmbeddedFiles() ); - simLibMgr.SetFilesStack( embeddedFilesStack ); + simLibMgr.SetFilesStack( std::move( embeddedFilesStack ) ); NULL_REPORTER devnull; SIM_MODEL& model = simLibMgr.CreateModel( aPath, const_cast( *this ), diff --git a/eeschema/sim/sim_lib_mgr.cpp b/eeschema/sim/sim_lib_mgr.cpp index b87d90f96c..3507641bce 100644 --- a/eeschema/sim/sim_lib_mgr.cpp +++ b/eeschema/sim/sim_lib_mgr.cpp @@ -66,7 +66,7 @@ wxString SIM_LIB_MGR::ResolveLibraryPath( const wxString& aLibraryPath, REPORTER for( const EMBEDDED_FILES* embeddedFiles : m_embeddedFilesStack ) embeddedFilesStack.push_back( embeddedFiles ); - wxString expandedPath = resolver.ResolvePath( aLibraryPath, wxEmptyString, embeddedFilesStack ); + wxString expandedPath = resolver.ResolvePath( aLibraryPath, wxEmptyString, std::move( embeddedFilesStack ) ); wxFileName fn( expandedPath ); diff --git a/eeschema/sim/sim_lib_mgr.h b/eeschema/sim/sim_lib_mgr.h index 0c315b0db3..c95a738625 100644 --- a/eeschema/sim/sim_lib_mgr.h +++ b/eeschema/sim/sim_lib_mgr.h @@ -46,8 +46,10 @@ public: void Clear(); - void SetFilesStack( std::vector aFilesStack ) { m_embeddedFilesStack = aFilesStack; } - + void SetFilesStack( std::vector aFilesStack ) + { + m_embeddedFilesStack = std::move( aFilesStack ); + } void SetLibrary( const wxString& aLibraryPath, REPORTER& aReporter ); diff --git a/eeschema/sim/sim_model.cpp b/eeschema/sim/sim_model.cpp index d4a6e88247..2bdb464cfa 100644 --- a/eeschema/sim/sim_model.cpp +++ b/eeschema/sim/sim_model.cpp @@ -1233,15 +1233,15 @@ bool SIM_MODEL::InferSimModel( T& aSymbol, std::vector* aFields, bool { aModelParams->Printf( wxT( "%s=\"%s%s\"" ), prefix.Left(1).Lower(), - valueMantissa, + std::move( valueMantissa ), convertNotation( valueExponent ) ); } else { aModelParams->Printf( wxT( "%s=\"%s.%s%s\"" ), prefix.Left(1).Lower(), - valueMantissa, - valueFraction, + std::move( valueMantissa ), + std::move( valueFraction ), convertNotation( valueExponent ) ); } } @@ -1303,17 +1303,17 @@ bool SIM_MODEL::InferSimModel( T& aSymbol, std::vector* aFields, bool if( valueMantissa.Contains( wxT( "." ) ) || valueFraction.IsEmpty() ) { aModelParams->Printf( wxT( "%s=\"%s%s\" %s" ), - param, - valueMantissa, + std::move( param ), + std::move( valueMantissa ), convertNotation( valueExponent ), *aModelParams ); } else { aModelParams->Printf( wxT( "%s=\"%s.%s%s\" %s" ), - param, - valueMantissa, - valueFraction, + std::move( param ), + std::move( valueMantissa ), + std::move( valueFraction ), convertNotation( valueExponent ), *aModelParams ); } @@ -1321,8 +1321,8 @@ bool SIM_MODEL::InferSimModel( T& aSymbol, std::vector* aFields, bool else { aModelParams->Printf( wxT( "%s=\"%s\" %s" ), - param, - value, + std::move( param ), + std::move( value ), *aModelParams ); } } @@ -1691,7 +1691,7 @@ void SIM_MODEL::MigrateSimModel( T& aSymbol, const PROJECT* aProject ) embeddedFilesStack.push_back( aSymbol.GetEmbeddedFiles() ); - libMgr.SetFilesStack( embeddedFilesStack ); + libMgr.SetFilesStack( std::move( embeddedFilesStack ) ); // Pull out any following parameters from model name model = model.BeforeFirst( ' ', &modelLineParams ); diff --git a/eeschema/sim/sim_model_ibis.cpp b/eeschema/sim/sim_model_ibis.cpp index 71834cc80b..e65f956c1c 100644 --- a/eeschema/sim/sim_model_ibis.cpp +++ b/eeschema/sim/sim_model_ibis.cpp @@ -66,7 +66,7 @@ std::string SPICE_GENERATOR_IBIS::IbisDevice( const SPICE_ITEM& aItem, SCHEMATIC std::vector embeddedFilesStack; embeddedFilesStack.push_back( aSchematic->GetEmbeddedFiles() ); - mgr.SetFilesStack( embeddedFilesStack ); + mgr.SetFilesStack( std::move( embeddedFilesStack ) ); wxString path = mgr.ResolveLibraryPath( ibisLibFilename, reporter ); diff --git a/eeschema/sim/simulator_frame_ui.cpp b/eeschema/sim/simulator_frame_ui.cpp index 87d49934a8..9e984e3501 100644 --- a/eeschema/sim/simulator_frame_ui.cpp +++ b/eeschema/sim/simulator_frame_ui.cpp @@ -1670,7 +1670,7 @@ void SIMULATOR_FRAME_UI::UpdateTunerValue( const SCH_SHEET_PATH& aSheetPath, con embeddedFilesStack.push_back( m_schematicFrame->Schematic().GetEmbeddedFiles() ); embeddedFilesStack.push_back( symbol->GetEmbeddedFiles() ); - mgr.SetFilesStack( embeddedFilesStack ); + mgr.SetFilesStack( std::move( embeddedFilesStack ) ); SIM_MODEL& model = mgr.CreateModel( &aSheetPath, *symbol, true, 0, devnull ).model; diff --git a/eeschema/tools/ee_grid_helper.cpp b/eeschema/tools/ee_grid_helper.cpp index 971137805c..7ed40983b2 100644 --- a/eeschema/tools/ee_grid_helper.cpp +++ b/eeschema/tools/ee_grid_helper.cpp @@ -469,7 +469,7 @@ void EE_GRID_HELPER::computeAnchors( SCH_ITEM *aItem, const VECTOR2I &aRefPos, b if( aIncludeText ) { addAnchor( aItem->GetPosition(), SNAPPABLE | CORNER, aItem ); - addAnchor( dynamic_cast( aItem )->GetEnd(), SNAPPABLE | CORNER, aItem ); + addAnchor( static_cast( aItem )->GetEnd(), SNAPPABLE | CORNER, aItem ); } break; diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 7c48c868aa..b22908a3ac 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -589,7 +589,7 @@ int SCH_EDITOR_CONTROL::SimProbe( const TOOL_EVENT& aEvent ) embeddedFilesStack.push_back( m_frame->Schematic().GetEmbeddedFiles() ); embeddedFilesStack.push_back( symbol->GetEmbeddedFiles() ); - mgr.SetFilesStack( embeddedFilesStack ); + mgr.SetFilesStack( std::move( embeddedFilesStack ) ); SIM_MODEL& model = mgr.CreateModel( &sheet, *symbol, true, 0, reporter ).model; diff --git a/kicad/dialogs/panel_jobset.cpp b/kicad/dialogs/panel_jobset.cpp index 603b22f183..a8fea08628 100644 --- a/kicad/dialogs/panel_jobset.cpp +++ b/kicad/dialogs/panel_jobset.cpp @@ -388,7 +388,8 @@ private: JOBS_GRID_TRICKS::JOBS_GRID_TRICKS( PANEL_JOBSET* aParent, WX_GRID* aGrid ) : GRID_TRICKS( aGrid ), - m_parent( aParent ) + m_parent( aParent ), + m_doubleClickRow( -1 ) { m_enableSingleClickEdit = false; m_multiCellEditEnabled = false; diff --git a/pcbnew/board_commit.cpp b/pcbnew/board_commit.cpp index 3e2b1dcbe3..e941f46323 100644 --- a/pcbnew/board_commit.cpp +++ b/pcbnew/board_commit.cpp @@ -420,7 +420,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags ) case CHT_MODIFY: { - BOARD_ITEM* boardItemCopy = dynamic_cast( ent.m_copy ); + BOARD_ITEM* boardItemCopy = static_cast( ent.m_copy ); if( !( aCommitFlags & SKIP_UNDO ) ) { diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index f3d4b633fd..f34ff33f2e 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -519,7 +519,7 @@ void DIALOG_DRC::OnDRCItemSelected( wxDataViewEvent& aEvent ) if( violationLayers.count() ) principalLayer = violationLayers.Seq().front(); - else if( !(principalLayer <= UNDEFINED_LAYER ) ) + else if( principalLayer >= 0 ) violationLayers.set( principalLayer ); WINDOW_THAWER thawer( m_frame ); diff --git a/pcbnew/dialogs/dialog_footprint_checker.cpp b/pcbnew/dialogs/dialog_footprint_checker.cpp index 1916a4019b..1511e7192f 100644 --- a/pcbnew/dialogs/dialog_footprint_checker.cpp +++ b/pcbnew/dialogs/dialog_footprint_checker.cpp @@ -298,7 +298,7 @@ void DIALOG_FOOTPRINT_CHECKER::OnSelectItem( wxDataViewEvent& aEvent ) if( violationLayers.count() ) principalLayer = violationLayers.Seq().front(); - else + else if( principalLayer >= 0 ) violationLayers.set( principalLayer ); WINDOW_THAWER thawer( m_frame ); diff --git a/pcbnew/exporters/export_idf.cpp b/pcbnew/exporters/export_idf.cpp index 5ad51218b7..0e4fb7387c 100644 --- a/pcbnew/exporters/export_idf.cpp +++ b/pcbnew/exporters/export_idf.cpp @@ -441,7 +441,7 @@ static void idf_export_footprint( BOARD* aPcb, FOOTPRINT* aFootprint, IDF3_BOARD embeddedFilesStack.push_back( aFootprint->GetEmbeddedFiles() ); embeddedFilesStack.push_back( aPcb->GetEmbeddedFiles() ); - idfFile.Assign( resolver->ResolvePath( sM->m_Filename, footprintBasePath, embeddedFilesStack ) ); + idfFile.Assign( resolver->ResolvePath( sM->m_Filename, footprintBasePath, std::move( embeddedFilesStack ) ) ); idfExt = idfFile.GetExt(); if( idfExt.Cmp( wxT( "idf" ) ) && idfExt.Cmp( wxT( "IDF" ) ) ) diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 00bb4332e7..1adf2bd4a1 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -206,6 +206,7 @@ static const TOOL_ACTION ACT_SwitchCornerMode( TOOL_ACTION_ARGS() ROUTER_TOOL::ROUTER_TOOL() : TOOL_BASE( "pcbnew.InteractiveRouter" ), + m_lastTargetLayer( UNDEFINED_LAYER ), m_originalActiveLayer( UNDEFINED_LAYER ), m_inRouterTool( false ) {