freeze index site in BoundsCheckEvent::compile

This ensures we don't use it as a temporary register when generating
the comparison.
This commit is contained in:
Joel Dice 2010-11-09 11:34:56 -07:00
parent 110f41b7a0
commit 70fcbc2788

View File

@ -4885,10 +4885,14 @@ class BoundsCheckEvent: public Event {
lengthOffset, NoRegister, 1);
length.acquired = true;
index->source->freeze(c, index);
ConstantSite next(nextPromise);
apply(c, JumpIfGreater, 4, index->source, index->source, 4, &length,
&length, BytesPerWord, &next, &next);
index->source->thaw(c, index);
if (constant == 0) {
outOfBoundsPromise->offset = a->offset();
}