diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-02-13 14:59:48 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-02-13 17:27:34 +0100 |
commit | ca1c8b447110321664a7a385dda5af6e303a91c8 (patch) | |
tree | 4db844b901e00c03045b35adafa942b98011638f /unoidl | |
parent | 1db5b87fe69c2375f1d66974dafcd563303c76db (diff) |
we don't need the reg or store libraries for fuzzing
possibly other configations too, but just for fuzzing for the moment
from looking at:
https://oss-fuzz.com/coverage-report/job/libfuzzer_asan_libreoffice/latest
and see what is built but is 0% coverage and uninteresting to be non-0
Change-Id: Ia7afdfc033dd8a705d85c76b246dc5dfb259b063
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163311
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'unoidl')
-rw-r--r-- | unoidl/Library_unoidl.mk | 8 | ||||
-rw-r--r-- | unoidl/source/unoidl.cxx | 9 |
2 files changed, 16 insertions, 1 deletions
diff --git a/unoidl/Library_unoidl.mk b/unoidl/Library_unoidl.mk index ff37972eec96..4b3dba1b5ab8 100644 --- a/unoidl/Library_unoidl.mk +++ b/unoidl/Library_unoidl.mk @@ -12,13 +12,19 @@ $(eval $(call gb_Library_Library,unoidl)) $(eval $(call gb_Library_add_defs,unoidl,-DLO_DLLIMPLEMENTATION_UNOIDL)) $(eval $(call gb_Library_add_exception_objects,unoidl, \ - unoidl/source/legacyprovider \ unoidl/source/sourcefileprovider \ unoidl/source/sourcetreeprovider \ unoidl/source/unoidl \ unoidl/source/unoidlprovider \ )) +# drop legacy provider for fuzzing +ifeq (,$(filter FUZZERS,$(BUILD_TYPE))) +$(eval $(call gb_Library_add_exception_objects,unoidl, \ + unoidl/source/legacyprovider \ +)) +endif + $(eval $(call gb_Library_add_grammars,unoidl, \ unoidl/source/sourceprovider-parser \ )) diff --git a/unoidl/source/unoidl.cxx b/unoidl/source/unoidl.cxx index 2022bcd058ac..acf984613420 100644 --- a/unoidl/source/unoidl.cxx +++ b/unoidl/source/unoidl.cxx @@ -14,6 +14,8 @@ #include <utility> #include <vector> +#include <config_fuzzers.h> + #include <osl/file.h> #include <osl/file.hxx> #include <osl/mutex.hxx> @@ -21,7 +23,9 @@ #include <rtl/ustring.hxx> #include <unoidl/unoidl.hxx> +#if !ENABLE_FUZZERS #include "legacyprovider.hxx" +#endif #include "sourcefileprovider.hxx" #include "sourcetreeprovider.hxx" #include "unoidlprovider.hxx" @@ -211,11 +215,16 @@ rtl::Reference< Provider > Manager::loadProvider(OUString const & uri) { try { return new detail::UnoidlProvider(uri); } catch (FileFormatException & e) { +#if !ENABLE_FUZZERS SAL_INFO( "unoidl", "FileFormatException \"" << e.getDetail() << "\", retrying <" << uri << "> as legacy format"); return new detail::LegacyProvider(*this, uri); +#else + (void)e; + return nullptr; +#endif } } |