Bug 1207827 - Fix ARM64 OOM bugs in Assembler::bind(). r=nbp

--HG--
extra : rebase_source : 2fe66f442dd68ebb8a3cf09cb638f649b9e61466
This commit is contained in:
Jakob Olesen 2015-10-20 12:57:39 -07:00
parent 84e7b07d84
commit cd23e799de

View File

@ -221,7 +221,10 @@ void
Assembler::bind(Label* label, BufferOffset targetOffset)
{
// Nothing has seen the label yet: just mark the location.
if (!label->used()) {
// If we've run out of memory, don't attempt to modify the buffer which may
// not be there. Just mark the label as bound to the (possibly bogus)
// targetOffset.
if (!label->used() || oom()) {
label->bind(targetOffset.getOffset());
return;
}
@ -259,7 +262,9 @@ void
Assembler::bind(RepatchLabel* label)
{
// Nothing has seen the label yet: just mark the location.
if (!label->used()) {
// If we've run out of memory, don't attempt to modify the buffer which may
// not be there. Just mark the label as bound to nextOffset().
if (!label->used() || oom()) {
label->bind(nextOffset().getOffset());
return;
}