Skip to content

Commit

Permalink
Don't assume number of parameters.
Browse files Browse the repository at this point in the history
This can happen now since we continue processing after a parse error.
  • Loading branch information
khatchad committed Jul 29, 2024
1 parent a82a371 commit 4e39344
Showing 1 changed file with 3 additions and 2 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

0 comments on commit 4e39344

Please sign in to comment.