From 580ed1ec6d356d59b222d5c18868e88f642b61e7 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Fri, 29 Sep 2017 22:14:35 +0200 Subject: [PATCH] Avoid a segfault that happens on first use of LEF/DEF reader. --- src/ext/ext/extLEFDEFPlugin.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ext/ext/extLEFDEFPlugin.cc b/src/ext/ext/extLEFDEFPlugin.cc index dc2c2a78d..2c465aeb9 100644 --- a/src/ext/ext/extLEFDEFPlugin.cc +++ b/src/ext/ext/extLEFDEFPlugin.cc @@ -126,6 +126,10 @@ private: const db::LayerMap &read_lefdef (db::Layout &layout, const db::LoadLayoutOptions &options, bool import_lef) throw (tl::Exception) { const ext::LEFDEFReaderOptions *lefdef_options = dynamic_cast (options.get_options (format ())); + static ext::LEFDEFReaderOptions default_options; + if (! lefdef_options) { + lefdef_options = &default_options; + } // Take the layer map and the "read all layers" flag from the reader options - hence we override the ext::LEFDEFLayerDelegate layers (lefdef_options);