Commit 5258c836 authored by Skylot's avatar Skylot

core: fix NPE in loops processing

parent eb6d145d
......@@ -311,11 +311,14 @@ public class RegionMaker {
AttributesList outAttrs = out.getAttributes();
if (outAttrs.contains(AttributeFlag.LOOP_START)
&& outAttrs.get(AttributeType.LOOP) != loop
&& stack.peekRegion() instanceof LoopRegion
&& RegionUtils.isRegionContainsBlock(stack.peekRegion(), out)) {
&& stack.peekRegion() instanceof LoopRegion) {
LoopRegion outerLoop = (LoopRegion) stack.peekRegion();
if (outerLoop.getBody() == null /* processing not yet finished */
|| RegionUtils.isRegionContainsBlock(outerLoop, out)) {
// exit to outer loop which already processed
out = null;
}
}
stack.push(loopRegion);
stack.addExit(out);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment