Skip to content

Commit

Permalink
jvmti: Fix Java.choose() on 32-bit systems
Browse files Browse the repository at this point in the history
A jlong is 64 bits wide.
  • Loading branch information
oleavr committed Dec 13, 2024
1 parent 653246e commit a8a6d77
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/class-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,15 +566,16 @@ class ClassFactory {
const JVMTI_HEAP_OBJECT_EITHER = 3;

const h = classWrapper.$borrowClassHandle(env);
const tag = int64(h.value.toString());

Check failure on line 569 in lib/class-factory.js

View workflow job for this annotation

GitHub Actions / eslint

'int64' is not defined
try {
const heapObjectCallback = new NativeCallback((classTag, size, tagPtr, userData) => {
tagPtr.writePointer(h.value);
tagPtr.writeS64(tag);
return JVMTI_ITERATION_CONTINUE;
}, 'int', ['long', 'long', 'pointer', 'pointer']);
}, 'int', ['int64', 'int64', 'pointer', 'pointer']);
jvmti.iterateOverInstancesOfClass(h.value, JVMTI_HEAP_OBJECT_EITHER, heapObjectCallback, h.value);

const tagPtr = Memory.alloc(pointerSize);
tagPtr.writePointer(h.value);
const tagPtr = Memory.alloc(8);
tagPtr.writeS64(tag);
const countPtr = Memory.alloc(jsizeSize);
const objectsPtr = Memory.alloc(pointerSize);
jvmti.getObjectsWithTags(1, tagPtr, countPtr, objectsPtr, NULL);
Expand Down

0 comments on commit a8a6d77

Please sign in to comment.