From ca7ecd37c94e268972697a37eec4e46771c6e6f2 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Thu, 4 Oct 2018 22:04:26 +0200 Subject: Bug 1493900. DiD fix. --- js/src/jit/BacktrackingAllocator.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'js') diff --git a/js/src/jit/BacktrackingAllocator.cpp b/js/src/jit/BacktrackingAllocator.cpp index 73aceeccb..741ed1592 100644 --- a/js/src/jit/BacktrackingAllocator.cpp +++ b/js/src/jit/BacktrackingAllocator.cpp @@ -1843,10 +1843,19 @@ BacktrackingAllocator::resolveControlFlow() LiveRange* from = vreg(input).rangeFor(exitOf(predecessor), /* preferRegister = */ true); MOZ_ASSERT(from); - if (!alloc().ensureBallast()) - return false; - if (!moveAtExit(predecessor, from, to, def->type())) + if (!alloc().ensureBallast()) { return false; + } + if (mSuccessor->numPredecessors() > 1) { + MOZ_ASSERT(predecessor->mir()->numSuccessors() == 1); + if (!moveAtExit(predecessor, from, to, def->type())) { + return false; + } + } else { + if (!moveAtEntry(successor, from, to, def->type())) { + return false; + } + } } } } -- cgit v1.2.3