Summary: Clang front-end is confused about exceptional CF. For the following program ``` void throw_positive(int b) { if (b > 0) { throw std::length_error("error"); } } void foo( std::vector<std::string> traceTokens){ if (traceTokens.size() < 13) { throw std::invalid_argument("Exception!"); // 1 } for (int i = 13; i < traceTokens.size(); ++i) { try { throw_positive(traceTokens[i].size()); } catch (std::range_error& msg) { throw(1); // 2 } try { throw_positive(traceTokens[7].size()); } catch (std::range_error& msg) { throw (9); // 3 } } } ``` Here, infer thinks that there are edges from 1->2 and 1-> 3. This should not be the case. This in turn makes control analysis think that there is a back edge from 3->2 and violates the assertion that the exit node (3 in this case) must be a prune node... Replacing assertion with internal error for now until I fix the clang frontend. Reviewed By: skcho Differential Revision: D25947376 fbshipit-source-id: 5c6529647master
parent
7b8145b8bc
commit
d1935941a6
Loading…
Reference in new issue