li-kai/Compiler

Buggy IR3

Opened this issue · 0 comments

The following program

class BoolOpsMain {
  Void main() {
    Simple x;
    x = new Simple();
    x.x = 12;
  }
}

class Simple {
  Int x;
}

generates the following IR3

void main(BoolOpsMain this){
  Simple x;
  Simple _t1;
  Int _t2;
  Int _t3;
  _t1=new Simple();
  x=_t1;
  _t2=x.x;
  _t3=12;
  _t2=_t3;
}

which is wrong since we need to assign _t3 to x.x instead of _t2.

:(