lsils / mockturtle

C++ logic network library
MIT License
191 stars 133 forks source link

Make `lbool` explicitly signed #650

Closed rocallahan closed 2 weeks ago

rocallahan commented 1 month ago

This avoids issues due to some platforms making char signed and others unsigned. In particular, on platforms where char is unsigned, https://github.com/lsils/mockturtle/blob/50ffa108484ba65b44eee4a713832b7ee821d6d8/lib/bill/bill/sat/interface/abc_bsat2.hpp#L156 promotes an lbool to int and compares to -1 ... but promoting (unsigned char)-1 to int produces 255.

costamag commented 2 weeks ago

Verified correct behavior on experiments Thanks for catching the issue