From 72c4061eeaaeac90c76b1b33499ffe0fe65d451f Mon Sep 17 00:00:00 2001 From: Roland Kaminski Date: Wed, 11 Dec 2024 11:44:47 +0100 Subject: [PATCH] check backend type --- libclingo/src/control.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libclingo/src/control.cc b/libclingo/src/control.cc index 0a7b663e3..9bd29c85a 100644 --- a/libclingo/src/control.cc +++ b/libclingo/src/control.cc @@ -2221,6 +2221,9 @@ extern "C" bool clingo_control_register_backend(clingo_control_t *control, cling backend = Output::make_backend(std::move(out), Output::OutputFormat::INTERMEDIATE, false, false); break; } + default: { + throw std::runtime_error("invalid backend type given"); + } } control->registerObserver(std::move(backend), replace); }