Skip to content

JVM class file parsing issue with BigInteger #920

@atomb

Description

@atomb

Consider the following SAWScript file that is a starting point toward specifying a function from the Java BigInteger class:

enable_experimental;

let bigint_add_setup n = do {
    x <- jvm_alloc_object "java.math.BigInteger";
    y <- jvm_alloc_object "java.math.BigInteger";
    jvm_execute_func [x, y];
    z <- jvm_alloc_object "java.math.BigInteger";
    jvm_return z;
};

let main : TopLevel () = do {
    bi <- java_load_class "java.math.BigInteger";
    let name = "add(Ljava/math/BigInteger;)Ljava/math/BigInteger;";
    crucible_jvm_verify bi name [] false (bigint_add_setup 8) z3;
    print "Done.";
};

When running this under with commit fa72caf, I get the following error:

[22:47:52.803] Loading file "/Users/atomb/galois/saw-script/examples/java/java-bigint/bug.saw"
[22:47:53.059] Index 98 is not a method reference.
CallStack (from HasCallStack):
  error, called at src/Language/JVM/Parser.hs:387:12 in jvm-parser-0.3.0.0-inplace:Language.JVM.Parser

This is with saw -j /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre/lib/rt.jar with the Homebrew package adoptopenjdk8 installed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    subsystem: crucible-jvmIssues related to Java verification with crucible-jvm

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions