Skip to content

Commit a332c27

Browse files
smowtontautschnig
authored andcommitted
Value-set: compare against real type, not followed type
1 parent 1bb1662 commit a332c27

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

src/pointer-analysis/value_set.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,10 +1154,10 @@ void value_sett::assign(
11541154
}
11551155
else
11561156
{
1157-
if(rhs.type() != type)
1157+
if(rhs.type() != lhs.type())
11581158
throw "value_sett::assign type mismatch: "
11591159
"rhs.type():\n"+rhs.type().pretty()+"\n"+
1160-
"type:\n"+type.pretty();
1160+
"lhs.type():\n"+lhs.type().pretty();
11611161

11621162
rhs_member=make_member(rhs, name, ns);
11631163

src/pointer-analysis/value_set_fi.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -989,10 +989,10 @@ void value_set_fit::assign(
989989
}
990990
else
991991
{
992-
if(rhs.type() != type)
992+
if(rhs.type() != lhs.type())
993993
throw "value_set_fit::assign type mismatch: "
994994
"rhs.type():\n"+rhs.type().pretty()+"\n"+
995-
"type:\n"+type.pretty();
995+
"type:\n"+lhs.type().pretty();
996996

997997
if(rhs.id()==ID_struct ||
998998
rhs.id()==ID_constant)

src/pointer-analysis/value_set_fivr.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,10 +1104,9 @@ void value_set_fivrt::assign(
11041104
}
11051105
else
11061106
{
1107-
if(rhs.type() != type)
1108-
throw
1109-
"type mismatch:\nRHS: "+rhs.type().pretty()+"\n"+
1110-
"LHS: "+type.pretty();
1107+
if(rhs.type() != lhs.type())
1108+
throw "type mismatch:\nRHS: " + rhs.type().pretty() + "\n" +
1109+
"LHS: " + lhs.type().pretty();
11111110

11121111
if(rhs.id()==ID_struct ||
11131112
rhs.id()==ID_constant)

src/pointer-analysis/value_set_fivrns.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -797,10 +797,9 @@ void value_set_fivrnst::assign(
797797
}
798798
else
799799
{
800-
if(rhs.type() != type)
801-
throw
802-
"type mismatch:\nRHS: "+rhs.type().pretty()+"\n"+
803-
"LHS: "+type.pretty();
800+
if(rhs.type() != lhs.type())
801+
throw "type mismatch:\nRHS: " + rhs.type().pretty() + "\n" +
802+
"LHS: " + lhs.type().pretty();
804803

805804
if(rhs.id()==ID_struct ||
806805
rhs.id()==ID_constant)

0 commit comments

Comments
 (0)