Skip to content

Commit

Permalink
Treat address as 64 bit integer to match native call. Related to keys…
Browse files Browse the repository at this point in the history
  • Loading branch information
bon96 committed Aug 18, 2021
1 parent 1475885 commit 38495da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bindings/java/src/main/java/keystone/Keystone.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public KeystoneEncoded assemble(String assembly) {
* @return The return value is the machine code of the assembly instructions.
* @throws AssembleFailedKeystoneException if the assembly code cannot be assembled properly.
*/
public KeystoneEncoded assemble(String assembly, int address) {
public KeystoneEncoded assemble(String assembly, long address) {
var pointerToMachineCodeBuffer = new PointerByReference();
var pointerToMachineCodeSize = new IntByReference();
var pointerToNumberOfStatements = new IntByReference();
Expand Down Expand Up @@ -161,7 +161,7 @@ public KeystoneEncoded assemble(Iterable<String> assembly) {
* @return The return value is the machine code of the assembly instructions.
* @throws AssembleFailedKeystoneException if the assembly code cannot be assembled properly.
*/
public KeystoneEncoded assemble(Iterable<String> assembly, int address) {
public KeystoneEncoded assemble(Iterable<String> assembly, long address) {
return assemble(String.join(";", assembly), address);
}

Expand Down
6 changes: 3 additions & 3 deletions bindings/java/src/main/java/keystone/KeystoneEncoded.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class KeystoneEncoded {
/**
* The address of the first assembly instruction.
*/
private final int address;
private final long address;

/**
* The number of statements successfully processed.
Expand All @@ -33,7 +33,7 @@ public class KeystoneEncoded {
* @param address The address of the first assembly instruction.
* @param numberOfStatements The number of statements successfully processed.
*/
public KeystoneEncoded(byte[] machineCode, int address, int numberOfStatements) {
public KeystoneEncoded(byte[] machineCode, long address, int numberOfStatements) {
this.machineCode = machineCode;
this.address = address;
this.numberOfStatements = numberOfStatements;
Expand All @@ -49,7 +49,7 @@ public byte[] getMachineCode() {
/**
* Gets the address of the first assembly instruction.
*/
public int getAddress() {
public long getAddress() {
return address;
}

Expand Down

0 comments on commit 38495da

Please sign in to comment.