Skip to content

Commit 0904ff6

Browse files
committed
Add safe rules using u8 instead of c_char
1 parent e5356d0 commit 0904ff6

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

rules/string/tgt_refcount.rs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,52 @@ fn f26(a0: Ptr<Vec<u8>>, a1: usize) -> Ptr<u8> {
125125
(a0.to_strong().as_pointer() as Ptr<u8>).offset(a1 as isize)
126126
}
127127
}
128+
129+
fn f2(a0: Vec<u8>) -> usize {
130+
(a0.len() - 1)
131+
}
132+
133+
fn f8(a0: std::fs::File, a1: std::fs::File) -> Vec<u8> {
134+
use std::io::Read;
135+
let mut __bytes: Vec<u8> = Vec::new();
136+
let mut __f = &a0;
137+
__f.read_to_end(&mut __bytes)
138+
.expect("couldn't read the file");
139+
__bytes.push(0);
140+
__bytes
141+
}
142+
143+
fn f9(a0: usize, a1: u8) -> Vec<u8> {
144+
vec![a1; (a0) as usize]
145+
.iter()
146+
.cloned()
147+
.chain(std::iter::once(0))
148+
.collect()
149+
}
150+
151+
fn f13(a0: &mut Vec<u8>, a1: usize) {
152+
a0.pop();
153+
a0.resize((a1) as usize, 0);
154+
a0.push(0)
155+
}
156+
157+
fn f19(a0: Vec<u8>) -> usize {
158+
(a0.len() - 1)
159+
}
160+
161+
fn f22(a0: Vec<u8>) -> bool {
162+
a0.len() <= 1
163+
}
164+
165+
fn f23() -> Vec<u8> {
166+
vec![0]
167+
}
168+
169+
fn f24(a0: &mut Vec<u8>) {
170+
a0.clear();
171+
a0.push(0)
172+
}
173+
174+
fn f25(a0: &mut Vec<u8>) {
175+
a0.shrink_to_fit()
176+
}

0 commit comments

Comments
 (0)