Skip to content

Commit

Permalink
Add a check
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-w committed Feb 24, 2020
1 parent 849e333 commit eff4de7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions profiler/lib.profiler/native/src-jdk15/Stacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ static void createTable()
resize_threshold = entries_size * 3 / 4;
ids = calloc(ids_size, sizeof(jmethodID));
entries = calloc(entries_size, sizeof(struct entry));
// TMP: announce
fputs("*** PROFILER INTERFACE 200223\n", stderr);
}
static jint convert_jmethodID_to_jint(jmethodID jmethod)
{
Expand Down Expand Up @@ -196,6 +198,11 @@ static jint convert_jmethodID_to_jint(jmethodID jmethod)
static jmethodID convert_jint_to_jmethodID(jint method)
{
assert(ids);
// TMP
if (method < 0 || method >= id_count) {
fprintf(stderr, "*** PROFILER INTERFACE Error request for method %d which is not known\n*** only 0-%d are valid\n", method, id_count - 1);
return (jmethodID) 0;
}
// fprintf(stderr, "*** Now unconvert %d to %p\n", method, ids[method]);
return ids[method];
}
Expand Down

0 comments on commit eff4de7

Please sign in to comment.