Simn / genjvm

13 stars 1 forks source link

operands in the wrong order when comparing with zero #26

Closed nadako closed 5 years ago

nadako commented 5 years ago
class Main {
    static function main() {
        var a = 1;
        var x = 0 < a;
    }
}
  public static void main(java.lang.String[]);
    Code:
       0: iconst_1
       1: istore_1
       2: iload_1
       3: ifge          10
       6: iconst_1
       7: goto          11
      10: iconst_0
      11: istore_2
      12: return
    public static void main(String[] args) {
        int a = 1;
        boolean x = a < 0;
    }

interesting, even tho instruction is ifge, intellij decompiler says <...

Simn commented 5 years ago

What's the problem with this though?

Simn commented 5 years ago

Oh, the problem is that it's wrong...