Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add zlib and liblzma functions used in The Silver Searcher to LibraryFunctions #1167

Merged
merged 3 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/analyses/libraryFunctions.ml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ let c_descs_list: (string * LibraryDesc.t) list = LibraryDsl.[
("vprintf", unknown [drop "format" [r]; drop "vlist" [r_deep]]); (* TODO: what to do with a va_list type? is r_deep correct? *)
("vfprintf", unknown [drop "stream" [r_deep; w_deep]; drop "format" [r]; drop "vlist" [r_deep]]); (* TODO: what to do with a va_list type? is r_deep correct? *)
("vsprintf", unknown [drop "buffer" [w]; drop "format" [r]; drop "vlist" [r_deep]]); (* TODO: what to do with a va_list type? is r_deep correct? *)
("vasprintf", unknown [drop "strp" [w]; drop "format" [r]; drop "ap" [r_deep]]); (* TODO: what to do with a va_list type? is r_deep correct? *)
("vsprintf", unknown [drop "str" [w]; drop "format" [r]; drop "ap" [r_deep]]); (* TODO: what to do with a va_list type? is r_deep correct? *)
karoliineh marked this conversation as resolved.
Show resolved Hide resolved
("mktime", unknown [drop "tm" [r;w]]);
("ctime", unknown ~attrs:[ThreadUnsafe] [drop "rm" [r]]);
("clearerr", unknown [drop "stream" [w]]);
Expand Down Expand Up @@ -288,6 +290,7 @@ let posix_descs_list: (string * LibraryDesc.t) list = LibraryDsl.[
("ftw", unknown ~attrs:[ThreadUnsafe] [drop "dirpath" [r]; drop "fn" [s]; drop "nopenfd" []]); (* TODO: use Call instead of Spawn *)
("nftw", unknown ~attrs:[ThreadUnsafe] [drop "dirpath" [r]; drop "fn" [s]; drop "nopenfd" []; drop "flags" []]); (* TODO: use Call instead of Spawn *)
("fnmatch", unknown [drop "pattern" [r]; drop "string" [r]; drop "flags" []]);
("realpath", unknown [drop "path" [r]; drop "resolved_path" [w]]);
]

(** Pthread functions. *)
Expand Down Expand Up @@ -824,6 +827,19 @@ let pcre_descs_list: (string * LibraryDesc.t) list = LibraryDsl.[
("pcre_version", unknown []);
]

let zlib_descs_list: (string * LibraryDesc.t) list = LibraryDsl.[
("inflate", unknown [drop "strm" [r_deep]; drop "flush" []]);
karoliineh marked this conversation as resolved.
Show resolved Hide resolved
("inflateInit2", unknown [drop "strm" [r_deep; w_deep]; drop "windowBits" []]);
("inflateInit2_", unknown [drop "strm" [r_deep; w_deep]; drop "windowBits" []; drop "version" [r]; drop "stream_size" []]);
("inflateEnd", unknown [drop "strm" [f_deep]]);
]

let liblzma_descs_list: (string * LibraryDesc.t) list = LibraryDsl.[
("lzma_code", unknown [drop "strm" [r_deep; w_deep]; drop "action" []]);
("lzma_auto_decoder", unknown [drop "strm" [r_deep; w_deep]; drop "memlimit" []; drop "flags" []]);
("lzma_end", unknown [drop "strm" [r_deep; w_deep]]);
karoliineh marked this conversation as resolved.
Show resolved Hide resolved
]

let libraries = Hashtbl.of_list [
("c", c_descs_list @ math_descs_list);
("posix", posix_descs_list);
Expand All @@ -837,6 +853,8 @@ let libraries = Hashtbl.of_list [
("ncurses", ncurses_descs_list);
("zstd", zstd_descs_list);
("pcre", pcre_descs_list);
("zlib", zlib_descs_list);
("liblzma", liblzma_descs_list);
]

let activated_library_descs: (string, LibraryDesc.t) Hashtbl.t ResettableLazy.t =
Expand Down
4 changes: 3 additions & 1 deletion src/util/options.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,9 @@
"sv-comp",
"ncurses",
"zstd",
"pcre"
"pcre",
"zlib",
"liblzma"
]
},
"default": [
Expand Down
Loading