# HG changeset patch # User Rik # Date 1487570478 28800 # Node ID 08042580fe93d8e1515a7dcb0cbc13f70fc8defb # Parent 9b0a2bc07545c75696d52c48a3d65f2d83767c1f Fix incorrect handling of 0b binary numbers in complex contstants. * lex.ll (handle_number): For number identified as binary, only look for '0' or '1' and ignore other characters such as 'i','j' used in complex notation. diff -r 9b0a2bc07545 -r 08042580fe93 libinterp/parse-tree/lex.ll --- a/libinterp/parse-tree/lex.ll Sun Feb 19 20:50:42 2017 -0800 +++ b/libinterp/parse-tree/lex.ll Sun Feb 19 22:01:18 2017 -0800 @@ -2794,8 +2794,13 @@ for (size_t i = 0; i < strlen (tmptxt); i++) { - long_int_value <<= 1; - long_int_value += static_cast (tmptxt[i] == '1'); + if (tmptxt[i] == '0') + long_int_value <<= 1; + else if (tmptxt[i] == '1') + { + long_int_value <<= 1; + long_int_value += 1; + } } value = static_cast (long_int_value);