clangupc / upc2c

Clang based UPC to C Translator
https://clangupc.github.io/clang-upc2c
Other
4 stars 3 forks source link

Bad translation of pts?: #89

Closed PHHargrove closed 10 years ago

PHHargrove commented 10 years ago

Given:

int foo(shared int *p) { return !p; }
int bar(shared int *p) { return p ? 0 : 1; }

the bodies of the respective translations are:

            return upcr_isnull_pshared(p);
            return p ? 0 : 1;

The second one is incorrect. With the struct-pts-rep this isn't valid C code. Even with packed-pts-rep this is valid C, but is correct since 'p' might be non-zero and still be a shared NULL.

I will take a stab at fixing this.

-Paul