Add mirsa predicates for RPL patterns - #117
Closed
990466307 wants to merge 2 commits into
Closed
Conversation
990466307
force-pushed
the
add-mirsa-predicates
branch
from
May 16, 2026 08:17
5e8adae to
0868193
Compare
Author
|
Superseded by #122, which rebases the MIRSA predicate work onto the current master and includes the Clippy patterns together with the new safety-requirement modeling. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
在 RPL 的谓词系统中接入 mirsa 的分析结果:
rpl_constraints/Cargo.toml 增加 mirsa_core 和 mirsa_domains 的依赖,依赖代码 在 third_party/mirsa。
predicates/mod.rs新增LocationLocal、LocationLocalConst、LocationLocalLocal三类谓词签名,注册is_null_mirsa、eq_const、lt_const、gt_const、index_in_bounds新增 null_analysis.rs 和 internval_analysis.rs 文件,查询指定 location 前的状态,返回 bool 给 RPL 谓词系统
locals.rs的BodyInfoCache<'tcx>,缓存每个函数体的null_mirsa和internval_mirsa结果把
transmuting-null、transmute-null-to-fnpattern 从is_null改为is_null_mirsa('cast, $null),并删掉其中专门处理中间 cast 的冗余 pattern新增
bytes-count-to-len、duration-subsec、string-from-utf8-as-bytes三个 pattern和相关测试