Skip to content

Commit ec250d2

Browse files
Merge pull request #2891 from sonodtt/invariant-cleanup-util_dir-irep_h_cpp
Cleanup asserts - replace with invariants
2 parents 91f15de + f0522e7 commit ec250d2

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/cpp/cpp_typecheck_fargs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Author: Daniel Kroening, kroening@cs.cmu.edu
1212
#ifndef CPROVER_CPP_CPP_TYPECHECK_FARGS_H
1313
#define CPROVER_CPP_CPP_TYPECHECK_FARGS_H
1414

15+
#include <cassert>
16+
1517
#include <util/std_code.h>
1618

1719
class cpp_typecheckt;

src/util/irep.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Author: Daniel Kroening, kroening@kroening.com
1313

1414
#include <ostream>
1515

16-
#include "invariant.h"
1716
#include "string2int.h"
1817
#include "string_hash.h"
1918
#include "irep_hash.h"

src/util/irep.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ Author: Daniel Kroening, kroening@kroening.com
1010
#ifndef CPROVER_UTIL_IREP_H
1111
#define CPROVER_UTIL_IREP_H
1212

13-
#include <cassert>
1413
#include <string>
1514
#include <vector>
1615

1716
#include "deprecate.h"
17+
#include "invariant.h"
1818
#include "irep_ids.h"
1919

2020
#define SHARING
@@ -192,7 +192,7 @@ class irept
192192
if(data!=&empty_d)
193193
{
194194
// NOLINTNEXTLINE(build/deprecated)
195-
assert(data->ref_count!=0);
195+
PRECONDITION(data->ref_count != 0);
196196
data->ref_count++;
197197
#ifdef IREP_DEBUG
198198
std::cout << "COPY " << data << " " << data->ref_count << '\n';

0 commit comments

Comments
 (0)