Project

Profile

Help

Revision e583527c

Added by Michael Kay over 11 years ago

Fix bug 3026439 Optimizer loop-lifting bug with document switching

View differences:

latest9.2/hej/net/sf/saxon/instruct/ForEach.java
203 203

  
204 204
    protected void promoteInst(PromotionOffer offer) throws XPathException {
205 205
        select = doPromotion(this, select, offer);
206
        action = doPromotion(this, action, offer);
206
        if (offer.action == PromotionOffer.INLINE_VARIABLE_REFERENCES ||
207
                offer.action == PromotionOffer.EXTRACT_GLOBAL_VARIABLES) {
208
            // Don't pass on other requests
209
            action = doPromotion(this, action, offer);
210
        }
207 211
    }
208 212

  
209 213
    /**
latest9.2/hej/net/sf/saxon/instruct/ForEachGroup.java
308 308

  
309 309
    protected void promoteInst(PromotionOffer offer) throws XPathException {
310 310
        select = doPromotion(this, select, offer);
311
        action = doPromotion(this, action, offer);
312
        key = doPromotion(this, key, offer);
311
        if (offer.action == PromotionOffer.INLINE_VARIABLE_REFERENCES ||
312
                offer.action == PromotionOffer.EXTRACT_GLOBAL_VARIABLES) {
313
            // Don't pass on other requests
314
            action = doPromotion(this, action, offer);
315
            key = doPromotion(this, key, offer);
316
        }
313 317
        // TODO: promote expressions in the sort key definitions
314
        // Note: this mechanism seems to make no distinction between subexpressions that change focus and those
315
        // that don't. This probably relies on some promotions never being used at the XSLT level.
316 318
    }
317 319

  
318 320
    /**

Also available in: Unified diff