Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/maven/org.ow2.asm-asm-all-6.0_BETA
Browse files Browse the repository at this point in the history
  • Loading branch information
khatchad authored Aug 6, 2024
2 parents a6f7280 + d287aba commit 161a6aa
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,11 @@ public IMethod getCalleeTarget(CGNode caller, CallSiteReference site, IClass rec
PythonTypes.Root)));
pc++;

int[] cps = new int[init.getNumberOfParameters()];
int numberOfParameters = init.getNumberOfParameters();
int[] cps = new int[numberOfParameters > 1 ? numberOfParameters : 2];
cps[0] = fv;
cps[1] = inst;
for (int j = 2; j < init.getNumberOfParameters(); j++) {
for (int j = 2; j < numberOfParameters; j++) {
cps[j] = j;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ protected boolean shouldProcess(CGNode caller, CallSiteReference site, IClass re

@Override
public IMethod getCalleeTarget(CGNode caller, CallSiteReference site, IClass receiver) {
// TODO: Callable detection may need to be moved. See https://github.com/wala/ML/issues/207. If
// it stays here, we should further document the receiver swapping process.
if (isCallable(receiver)) {
LOGGER.fine("Encountered callable.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ private void processWildcardImports(
Set<CGNode> nodes = callGraph.getNodes(importMethodReference);

if (nodes.isEmpty())
throw new IllegalStateException(
logger.warning(
"Can't find CG node for import method: "
+ importMethodReference.getSignature()
+ ".");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,29 +168,28 @@ private Util() {}

/**
* If the given {@link ConstantKey}'s value is <code>null</code>, then issue a warning and return
* <code>null</code>. Otherwise, throw an {@link IllegalArgumentException} stating that an {@link
* AllocationSiteInNode} cannot be extracted from the given {@link ConstantKey}. A value of <code>
* <code>null</code>. Otherwise, issue a warning stating that an {@link AllocationSiteInNode}
* cannot be extracted from the given {@link ConstantKey}. A value of <code>
* null</code> most likely indicates that a receiver can potentially be <code>null</code>.
*
* @param constantKey The {@link ConstantKey} from which to extract the corresponding {@link
* AllocationSiteInNode}.
* @return <code>null</code> if the given {@link ConstantKey}'s value is <code>null</code>.
* @throws IllegalArgumentException If the constant's value is another else other than <code>null
* </code>.
* @return <code>null</code>.
*/
private static AllocationSiteInNode getAllocationSiteInNode(ConstantKey<?> constantKey) {
Object value = constantKey.getValue();

if (value == null) {
if (value == null)
LOGGER.warning("Can't extract AllocationSiteInNode from: " + constantKey + ".");
return null;
} else
throw new IllegalArgumentException(
else
LOGGER.warning(
"Can't extract AllocationSiteInNode from: "
+ constantKey
+ ". Not expecting value of: "
+ value
+ " from ConstantKey.");

return null;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
black==24.4.2
black==24.8.0

0 comments on commit 161a6aa

Please sign in to comment.