From: Arnaud Giersch Date: Fri, 3 May 2019 20:26:32 +0000 (+0200) Subject: [sonar] Catch a more specific exception. X-Git-Tag: v3.22.2~2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/26897ac6e3ae5add8d64c16c97cc9121ba6e70bf [sonar] Catch a more specific exception. --- diff --git a/teshsuite/mc/dwarf-expression/dwarf-expression.cpp b/teshsuite/mc/dwarf-expression/dwarf-expression.cpp index 2dce6b2b37..8a63108c45 100644 --- a/teshsuite/mc/dwarf-expression/dwarf-expression.cpp +++ b/teshsuite/mc/dwarf-expression/dwarf-expression.cpp @@ -36,10 +36,9 @@ uintptr_t eval_binary_operation( ops[2].atom = op; simgrid::dwarf::ExpressionStack stack; - try { simgrid::dwarf::execute(ops, 3, state, stack); - } catch (const std::runtime_error&) { + } catch (const simgrid::dwarf::evaluation_error&) { fprintf(stderr,"Expression evaluation error"); } @@ -124,7 +123,7 @@ void basic_test(simgrid::dwarf::ExpressionContext const& state) { assert(stack.top() == a); assert(stack.top(1) == b); - } catch (const std::runtime_error&) { + } catch (const simgrid::dwarf::evaluation_error&) { fprintf(stderr,"Expression evaluation error"); } } @@ -146,7 +145,7 @@ void test_deref(simgrid::dwarf::ExpressionContext const& state) { assert(stack.size() == 1); assert(stack.top() == foo); - } catch (const std::runtime_error&) { + } catch (const simgrid::dwarf::evaluation_error&) { fprintf(stderr,"Expression evaluation error"); } }