C++'s std::string is modelled as a null-terminated Vec<u8>, but its type rule does not reflect this:
fn t1() -> Vec<libc::c_char> {
Vec::new()
}
Initializing strings with an empty vector, as opposed to initializing with vec![0], will cause problems with rules such as the rule for std::string::length, which assumes the string is null-terminated:
unsafe fn f19(a0: Vec<libc::c_char>) -> usize {
(a0.len() - 1)
}
C++'s
std::stringis modelled as a null-terminatedVec<u8>, but its type rule does not reflect this:Initializing strings with an empty vector, as opposed to initializing with
vec![0], will cause problems with rules such as the rule forstd::string::length, which assumes the string is null-terminated: