Skip to content

Commit 2ec0181

Browse files
author
Daniel Kroening
committed
simplifier: prevent spurious adding of type
Expressions should not be given a type() child if they don't have one.
1 parent 6163a70 commit 2ec0181

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/util/simplify_utils.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Author: Daniel Kroening, [email protected]
77
\*******************************************************************/
88

99
#include "simplify_utils.h"
10+
#include "as_const.h"
1011

1112
#include <algorithm>
1213

@@ -126,8 +127,8 @@ bool sort_and_join(exprt &expr)
126127
if(!expr.has_operands())
127128
return true;
128129

129-
const struct saj_tablet &saj_entry=
130-
sort_and_join(expr.id(), expr.type().id());
130+
const struct saj_tablet &saj_entry =
131+
sort_and_join(expr.id(), as_const(expr).type().id());
131132
if(saj_entry.id.empty())
132133
return true;
133134

0 commit comments

Comments
 (0)