Skip to content

Commit

Permalink
More informative exception in callTransferFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
smillst authored Jul 26, 2024
1 parent 90fcbe3 commit f94817b
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.common.basetype.BaseTypeChecker;
import org.checkerframework.dataflow.analysis.ForwardAnalysisImpl;
import org.checkerframework.dataflow.analysis.TransferInput;
import org.checkerframework.dataflow.analysis.TransferResult;
import org.checkerframework.dataflow.cfg.ControlFlowGraph;
import org.checkerframework.dataflow.cfg.node.Node;
import org.checkerframework.dataflow.expression.FieldAccess;
import org.checkerframework.framework.source.SourceChecker;
import org.checkerframework.framework.type.AnnotatedTypeFactory;
Expand All @@ -22,6 +25,7 @@
import org.checkerframework.framework.type.TypeHierarchy;
import org.checkerframework.framework.util.dependenttypes.DependentTypesHelper;
import org.checkerframework.javacutil.AnnotationMirrorSet;
import org.checkerframework.javacutil.BugInCF;
import org.checkerframework.javacutil.TypesUtils;

/**
Expand Down Expand Up @@ -231,6 +235,17 @@ public TypeHierarchy getTypeHierarchy() {
return atypeFactory;
}

@Override
protected TransferResult<V, S> callTransferFunction(Node node, TransferInput<V, S> input) {
TransferResult<V, S> result;
try {
result = super.callTransferFunction(node, input);
} catch (Throwable t) {
throw new BugInCF(node.getTree(), t);
}
return result;
}

/**
* Returns an abstract value containing an annotated type with the annotation {@code anno}, and
* 'top' for all other hierarchies. The underlying type is {@code underlyingType}.
Expand Down

0 comments on commit f94817b

Please sign in to comment.