ncsro / crest

Automatically exported from code.google.com/p/crest
0 stars 0 forks source link

unary operators intrumentation #12

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
value for Apply1 should be the top level one?

UnOp (op, e1, _) ->
            (instrumentExpr e1) @ [mkApply1 op e]

Original issue reported on code.google.com by mbal...@gmail.com on 11 Apr 2012 at 2:00

GoogleCodeExporter commented 8 years ago

This does appear to be a bug.  It causes a prediction failure for (for example):

#include <crest.h>
#include <stdio.h>

int main(void) {
  int x = 2;
  int a, b;
  CREST_int(a);
  b = -a;
  if (-x * a == 8) {
    printf("8 (%d %d)\n", a, b);
  } else {
    printf("not 8 (%d %d)\n", a, b);
  }
  return 0;
}

Original comment by jbur...@gmail.com on 11 May 2012 at 2:55

GoogleCodeExporter commented 8 years ago

And thanks for finding this!

Original comment by jbur...@gmail.com on 11 May 2012 at 2:56

GoogleCodeExporter commented 8 years ago

Fixed by http://code.google.com/p/crest/source/detail?r=132 .

Original comment by jbur...@gmail.com on 18 May 2012 at 4:42