Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat address as 64 bit integer in java binding to match native call. Related to #408 #508

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion bindings/java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,10 @@ Ping the contributors of the Java bindings when submitting a pull request, so yo
## License

The Java bindings for Keystone is open-sourced software licensed under the MIT license.
The license of the library Keystone may be different and is available [at the root of the repository of Keystone](https://github.com/keystone-engine/keystone).
The license of the library Keystone may be different and is available [at the root of the repository of Keystone](https://github.com/keystone-engine/keystone).



mvn package -DskipTests

mvn install:install-file -Dfile=F:\coding\java\keystone\bindings\java\target\java-bindings-0.9.1-0-jar-with-dependencies.jar -DgroupId=org.bon.keystone -DartifactId=keystone -Dversion=1.0 -Dpackaging=jar -DgeneratePom=true
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