mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 03:28:19 +00:00
streamlining CSE analysis of modifying record fields
This commit is contained in:
parent
d27ed0eb7a
commit
ed70fefd34
1 changed files with 1 additions and 13 deletions
|
@ -935,19 +935,7 @@ TraversalCode CSE_ValidityChecker::PreExpr(const Expr* e) {
|
||||||
auto lhs_aggr_id = lhs->AsNameExpr()->Id();
|
auto lhs_aggr_id = lhs->AsNameExpr()->Id();
|
||||||
auto lhs_field = e->AsFieldLHSAssignExpr()->Field();
|
auto lhs_field = e->AsFieldLHSAssignExpr()->Field();
|
||||||
|
|
||||||
if ( CheckID(lhs_aggr_id, true) || CheckAggrMod(lhs->GetType()) ) {
|
if ( CheckID(lhs_aggr_id, true) || (lhs_field == field && same_type(lhs_aggr_id->GetType(), field_type)) ) {
|
||||||
is_valid = false;
|
|
||||||
return TC_ABORTALL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ### do we need this?
|
|
||||||
if ( lhs_field == field && same_type(lhs_aggr_id->GetType(), field_type) ) {
|
|
||||||
ASSERT(0);
|
|
||||||
// Potential assignment to the same field as for
|
|
||||||
// our expression of interest. Even if the
|
|
||||||
// identifier involved is not one we have our eye
|
|
||||||
// on, due to aggregate aliasing this could be
|
|
||||||
// altering the value of our expression, so bail.
|
|
||||||
is_valid = false;
|
is_valid = false;
|
||||||
return TC_ABORTALL;
|
return TC_ABORTALL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue