saleyn / eixx

Erlang C++ Interface
Apache License 2.0
137 stars 26 forks source link

Handle UB in bit_scan_forward #20

Closed matwey closed 8 years ago

matwey commented 8 years ago

Commit 37ece8e0068c2dc523443d7a0cbfb541852d5197 introduced UB into bit_scan_forward when called with zero agrument.

Check m_type == UNDEFINED explicitly in to_type() Also replace bit_scan_forward return type to int to avoid double conversion.