From 314bdae80da0f3f1a3ecc4687f9e4f40a559ecd1 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Tue, 7 Dec 2010 18:16:19 -0700 Subject: [PATCH] freeze BranchEvent operands to ensure they aren't clobbered as temporaries --- src/compiler.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/compiler.cpp b/src/compiler.cpp index b6cf197157..23778520d6 100644 --- a/src/compiler.cpp +++ b/src/compiler.cpp @@ -4747,9 +4747,17 @@ class BranchEvent: public Event { apply(c, Jump, BytesPerWord, address->source, address->source); } } else { + freezeSource(c, size, first); + freezeSource(c, size, second); + freezeSource(c, BytesPerWord, address); + apply(c, type, size, first->source, first->nextWord->source, size, second->source, second->nextWord->source, BytesPerWord, address->source, address->source); + + thawSource(c, BytesPerWord, address); + thawSource(c, size, second); + thawSource(c, size, first); } } @@ -4914,13 +4922,13 @@ class BoundsCheckEvent: public Event { CodePromise* nextPromise = codePromise (c, static_cast(0)); - index->source->freeze(c, index); + freezeSource(c, BytesPerWord, index); ConstantSite next(nextPromise); apply(c, JumpIfGreater, 4, index->source, index->source, 4, &length, &length, BytesPerWord, &next, &next); - index->source->thaw(c, index); + thawSource(c, BytesPerWord, index); if (constant == 0) { outOfBoundsPromise->offset = a->offset();