From f216fe37ff4cc730b2709f8a405dca5043816fd0 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Tue, 1 Dec 2009 11:14:57 -0700 Subject: [PATCH] fix regression which led to register exhaustion --- src/compiler.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/compiler.cpp b/src/compiler.cpp index 311d4a288c..c666c252ec 100644 --- a/src/compiler.cpp +++ b/src/compiler.cpp @@ -2439,6 +2439,19 @@ maybeMove(Context* c, Read* read, bool intersectRead, bool includeNextWord, } if (cost) { + if (DebugMoves) { + char srcb[256]; src->toString(c, srcb, 256); + char dstb[256]; dst->toString(c, dstb, 256); + fprintf(stderr, "maybe move %s to %s for %p to %p\n", + srcb, dstb, value, value); + } + + src->freeze(c, value); + + addSite(c, value, dst); + + src->thaw(c, value); + if (not src->match(c, srcMask)) { src->freeze(c, value); dst->freeze(c, value); @@ -2450,6 +2463,8 @@ maybeMove(Context* c, Read* read, bool intersectRead, bool includeNextWord, Site* tmp = pickTargetSite(c, &tmpRead, true); + addSite(c, value, tmp); + move(c, value, src, tmp); dst->thaw(c, value); @@ -2851,10 +2866,9 @@ move(Context* c, Value* value, Site* src, Site* dst) srcb, dstb, value, value); } + assert(c, findSite(c, value, dst)); + src->freeze(c, value); - - addSite(c, value, dst); - dst->freeze(c, value); unsigned srcSize;