Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Catch a more specific exception.
[simgrid.git] / teshsuite / mc / dwarf-expression / dwarf-expression.cpp
index 2dce6b2..8a63108 100644 (file)
@@ -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");
   }
 }