SHA256
1
0
forked from pool/libminizinc
libminizinc/0002-Catch-std-exception-by-const-reference.patch
Dmitry Roshchin 3d1d9f345a - update to 2.8.5:
* Fix specification for constraint items and annotations in
    FlatZinc JSON.
  * Fix flattening of negated let expressions with constraints.
  * Fix crash when equating identifiers to tuples/records in if-
    then-else expressions.
  * Fix string_length function to return the number of Unicode
    code points rather than the number of bytes (i.e., to
    interpret the string as UTF-8).
  * Emit type error for opt tuples and records created through
    type aliases.
  * Fix evaluation of par partial functions returning arrays.
  * Fix type inference for if-then-else expressions with
    different tuple or record types in the branches.
  * Fix evaluation error caused by removal of fixed FlatZinc
    variables without fixing them in the output model.
  * Fix computed type when flattening cv comprehensions
    containing tuple or record types.
  * Fix unsatisfiability caused by reification in negated boolean
    context (:bugref:`813`).
  * Fix bug in computation of common type of incompatible record
    types.
  * Fix crash when type checking nested arrays of tuples or
    records.
  * Fix incorrect unification of flattened tuple/record fields
    with paths enabled.
  * Add string_split function that splits a string into an array
    of strings based on a separator.
  * Add json_section annotation to mark an output item as a JSON
    section (:bugref:`816`).

OBS-URL: https://build.opensuse.org/package/show/science/libminizinc?expand=0&rev=11
2024-09-12 06:48:05 +00:00

34 lines
1.2 KiB
Diff

From c1e1cc1f76cac901752a870ac44a2ebc45729d96 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Tue, 19 Jul 2022 19:31:23 +0200
Subject: [PATCH 2/3] Catch std::exception by const-reference
Although the details are ignored and do not matter, catching
std::exception by value is in general bad due to potential slicing,
and the potentially required copy.
---
include/minizinc/flatten.hh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/minizinc/flatten.hh b/include/minizinc/flatten.hh
index 2b631e82..b51c9625 100644
--- a/include/minizinc/flatten.hh
+++ b/include/minizinc/flatten.hh
@@ -87,11 +87,11 @@ struct FlatteningOptions {
try {
std::random_device rdev("/dev/urandom");
seeds.push_back(rdev());
- } catch (std::exception) {
+ } catch (const std::exception&) {
try {
std::random_device rdev;
seeds.push_back(rdev());
- } catch (std::exception) { /* NOLINT(bugprone-empty-catch) */
+ } catch (const std::exception&) { /* NOLINT(bugprone-empty-catch) */
}
}
auto highrestime = static_cast<long unsigned int>(
--
2.37.0