@@ -905,7 +905,7 @@ GlobOpt::FinishOptPropOp(IR::Instr *instr, IR::PropertySymOpnd *opnd, BasicBlock
905
905
906
906
SymID opndId = opnd->HasObjectTypeSym () ? opnd->GetObjectTypeSym ()->m_id : -1 ;
907
907
908
- if (!isObjTypeChecked )
908
+ if (!isObjTypeSpecialized || opnd-> IsBeingAdded () )
909
909
{
910
910
if (block->globOptData .maybeWrittenTypeSyms == nullptr )
911
911
{
@@ -1122,6 +1122,19 @@ GlobOpt::ProcessPropOpInTypeCheckSeq(IR::Instr* instr, IR::PropertySymOpnd *opnd
1122
1122
Assert (opnd->IsTypeCheckSeqCandidate ());
1123
1123
Assert (opnd->HasObjectTypeSym ());
1124
1124
1125
+ if (opnd->HasTypeMismatch ())
1126
+ {
1127
+ if (emitsTypeCheckOut != nullptr )
1128
+ {
1129
+ *emitsTypeCheckOut = false ;
1130
+ }
1131
+ if (changesTypeValueOut != nullptr )
1132
+ {
1133
+ *changesTypeValueOut = false ;
1134
+ }
1135
+ return false ;
1136
+ }
1137
+
1125
1138
bool isStore = opnd == instr->GetDst ();
1126
1139
bool isTypeDead = opnd->IsTypeDead ();
1127
1140
bool consumeType = makeChanges && !IsLoopPrePass ();
@@ -1229,7 +1242,7 @@ GlobOpt::ProcessPropOpInTypeCheckSeq(IR::Instr* instr, IR::PropertySymOpnd *opnd
1229
1242
// a new type value here.
1230
1243
isSpecialized = false ;
1231
1244
1232
- if (consumeType )
1245
+ if (makeChanges )
1233
1246
{
1234
1247
opnd->SetTypeMismatch (true );
1235
1248
}
@@ -1273,7 +1286,7 @@ GlobOpt::ProcessPropOpInTypeCheckSeq(IR::Instr* instr, IR::PropertySymOpnd *opnd
1273
1286
// a new type value here.
1274
1287
isSpecialized = false ;
1275
1288
1276
- if (consumeType )
1289
+ if (makeChanges )
1277
1290
{
1278
1291
opnd->SetTypeMismatch (true );
1279
1292
}
@@ -1324,7 +1337,7 @@ GlobOpt::ProcessPropOpInTypeCheckSeq(IR::Instr* instr, IR::PropertySymOpnd *opnd
1324
1337
{
1325
1338
// Indicates failure/mismatch
1326
1339
isSpecialized = false ;
1327
- if (consumeType )
1340
+ if (makeChanges )
1328
1341
{
1329
1342
opnd->SetTypeMismatch (true );
1330
1343
}
@@ -1423,7 +1436,7 @@ GlobOpt::ProcessPropOpInTypeCheckSeq(IR::Instr* instr, IR::PropertySymOpnd *opnd
1423
1436
// a new type value here.
1424
1437
isSpecialized = false ;
1425
1438
1426
- if (consumeType )
1439
+ if (makeChanges )
1427
1440
{
1428
1441
opnd->SetTypeMismatch (true );
1429
1442
}
0 commit comments