We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3000b6f + 5970771 commit c8b5380Copy full SHA for c8b5380
2 files changed
src/analyses/base.ml
@@ -2434,7 +2434,7 @@ struct
2434
| Addr.Addr (v, o) -> Addr.Addr (v, lo o)
2435
| other -> other in
2436
AD.map rmLastOffset a
2437
- | _ -> raise (Failure "String function: not an address")
+ | _ -> AD.top ()
2438
in
2439
let string_manipulation s1 s2 lv all op_addr op_array =
2440
let s1_v = eval_rv ~man st s1 in
tests/regression/73-strings/11-not-an-address.c
@@ -0,0 +1,18 @@
1
+// NOCRASH
2
+extern int strcmp(const char *, const char *);
3
+
4
+static int hello_read(const char *path) {
5
+ return strcmp(path, "Hello");
6
+}
7
8
+static const struct ops {
9
+ int (*read)(const char *);
10
+} hello_oper = {
11
+ .read = hello_read,
12
+};
13
14
+extern int main_real(const struct ops *);
15
16
+int main() {
17
+ return main_real(&hello_oper);
18
0 commit comments