fixes for ZAM's propagation of control flow information for some degenerate constructs

This commit is contained in:
Vern Paxson 2024-11-05 16:27:46 -08:00 committed by Arne Welzel
parent a3a0155825
commit 148215aa87
6 changed files with 72 additions and 3 deletions

View file

@ -1020,8 +1020,11 @@ void ZAMCompiler::BackPropagateCFT(int inst_num, ControlFlowType cf_type) {
if ( insts1[j]->live )
break;
// We should never wind up killing an instruction that has no predecessor.
ASSERT(j >= 0);
// Initializations of unused variables in functions with no arguments can
// come at the very beginning of the function, in which case there will
// be no predecessor to back-propagate to.
if ( j < 0 )
return;
// Make sure the CFT entry is created.
AddCFT(insts1[j], cf_type);