Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Make sure that encodings has entries for all instructions after legal…
Browse files Browse the repository at this point in the history
…ize().

If we generated new instructions as part of legalize, and the new
instructions failed to legalize, we'd be left with a func.encodings[]
that would panic when you dereferenced the inst.
  • Loading branch information
anholt authored and stoklund committed Apr 24, 2017
1 parent b13cd23 commit a332c3d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/cretonne/src/legalizer/mod.rs
Expand Up @@ -100,6 +100,7 @@ pub fn legalize_function(func: &mut Function, cfg: &mut ControlFlowGraph, isa: &
prev_pos = pos.position();
}
}
func.encodings.resize(func.dfg.num_insts());
}

// Include legalization patterns that were generated by `gen_legalizer.py` from the `XForms` in
Expand Down

0 comments on commit a332c3d

Please sign in to comment.