From c63521d67af30be1ca5734d192c0c8c87d485ec7 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Sun, 17 Mar 2019 17:11:24 +0100 Subject: [PATCH] work around potential null dereference warning * spot/twaalgos/ltl2taa.cc: Here. * NEWS: Mention the issue. --- NEWS | 5 +++++ spot/twaalgos/ltl2taa.cc | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index c9e36f4e0..01b168b0d 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,11 @@ New in spot 2.7.1.dev (not yet released) possible to iterate over a kripke_graph object in a way similar to twa_graph. + Build: + + - Work around a spurious null dereference warning when compiling + with --coverage and g++ 8.3.0-3 from Debian unstable. + New in spot 2.7.1 (2019-02-14) Build diff --git a/spot/twaalgos/ltl2taa.cc b/spot/twaalgos/ltl2taa.cc index 49c3880ee..6430f43cb 100644 --- a/spot/twaalgos/ltl2taa.cc +++ b/spot/twaalgos/ltl2taa.cc @@ -1,6 +1,6 @@ // -*- coding: utf-8 -*- -// Copyright (C) 2009-2010, 2012-2016, 2018 Laboratoire de Recherche -// et Développement de l'Epita (LRDE). +// Copyright (C) 2009-2010, 2012-2016, 2018-2019 Laboratoire de +// Recherche et Développement de l'Epita (LRDE). // // This file is part of Spot, a model checking library. // @@ -20,6 +20,7 @@ #include "config.h" #include #include +#include #include #include #include @@ -340,6 +341,10 @@ namespace spot for (unsigned i = 0; i < vs.size(); ++i) pos[i] = vs[i].succ_.size(); + // g++ (Debian 8.3.0-3) 8.3.0 in --coverage mode, + // reports a "potential null pointer dereference" on the next + // line without this assert... + assert(pos.size() > 0); while (pos[0] != 0) { std::vector u; // Union