use of jadx.core.utils.exceptions.JadxOverflowException in project jadx by skylot.
the class RegionMaker method makeRegion.
public Region makeRegion(BlockNode startBlock, RegionStack stack) {
if (Consts.DEBUG) {
int id = startBlock.getId();
if (processedBlocks.get(id)) {
LOG.debug(" Block already processed: {}, mth: {}", startBlock, mth);
} else {
processedBlocks.set(id);
}
}
regionsCount++;
if (regionsCount > REGIONS_LIMIT) {
throw new JadxOverflowException("Regions count limit reached");
}
Region r = new Region(stack.peekRegion());
BlockNode next = startBlock;
while (next != null) {
next = traverse(r, next, stack);
}
return r;
}
use of jadx.core.utils.exceptions.JadxOverflowException in project jadx by skylot.
the class ErrorsCounter method addError.
private void addError(IAttributeNode node, String msg, Throwable e) {
errorNodes.add(node);
errorsCount++;
if (e != null) {
if (e.getClass() == JadxOverflowException.class) {
// don't print full stack trace
e = new JadxOverflowException(e.getMessage());
LOG.error("{}, message: {}", msg, e.getMessage());
} else {
LOG.error(msg, e);
}
node.addAttr(new JadxErrorAttr(e));
} else {
node.add(AFlag.INCONSISTENT_CODE);
LOG.error(msg);
}
}
use of jadx.core.utils.exceptions.JadxOverflowException in project jadx by skylot.
the class DepthRegionTraversal method traverseIncludingExcHandlers.
public static void traverseIncludingExcHandlers(MethodNode mth, IRegionIterativeVisitor visitor) {
boolean repeat;
int k = 0;
do {
repeat = traverseIterativeStepInternal(mth, visitor, mth.getRegion());
if (!repeat) {
for (ExceptionHandler h : mth.getExceptionHandlers()) {
repeat = traverseIterativeStepInternal(mth, visitor, h.getHandlerRegion());
if (repeat) {
break;
}
}
}
if (k++ > ITERATIVE_LIMIT) {
throw new JadxOverflowException("Iterative traversal limit reached, method: " + mth);
}
} while (repeat);
}
Aggregations