Bug 1116646 - Avoid assertion when running out of virtual registers, r=jandem.

This commit is contained in:
Brian Hackett 2015-01-07 10:52:56 -07:00
parent 11a3161f3a
commit b8b1df6dc1

View File

@ -166,8 +166,11 @@ class LIRGeneratorShared : public MDefinitionVisitor
uint32_t getVirtualRegister() {
uint32_t vreg = lirGraph_.getVirtualRegister();
if (vreg >= MAX_VIRTUAL_REGISTERS) {
// Mark code generation as having failed, and return a dummy vreg.
// If we run out of virtual registers, mark code generation as having
// failed and return a dummy vreg. Include a + 1 here for NUNBOX32
// platforms that expect Value vregs to be adjacent.
if (vreg + 1 >= MAX_VIRTUAL_REGISTERS) {
gen->abort("max virtual registers");
return 1;
}