Skip to content

supporting symbolic conditions on reals #2

@vaibhavbsharma

Description

@vaibhavbsharma

If a region begins with a condition that is a symbolic expression over doubles, SPF will branch at the DCMP* instruction instead of branching at the subsequent if statement. Currently our regions begin at the if statement causing SPF to have already branched by the time it gets to the if.

Example.

public int checkOperator(double a, double b) {
        int ret = -1;
        if (a < b) ret = 1;
        else ret = 0;
        return ret;
    }

translates to the following Java bytecode:

public int checkOperator(double, double);
    Code:
       0: iconst_m1
       1: istore        5
       3: dload_1
       4: dload_3
       5: dcmpg
       6: ifge          15
       9: iconst_1
      10: istore        5
      12: goto          18
      15: iconst_0
      16: istore        5
      18: iload         5
      20: ireturn

SPF branches at the dcmpg instruction at offset 5 whereas our listener is waiting for it to get to the ifge at offset 6.

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions