Skip to content

Commit f77c2e5

Browse files
yuxuanchen1997facebook-github-bot
authored andcommitted
Upgrade im crate to 15.1
Summary: Upgrading im crate to 15.1 to avoid impact of CVE-2020-36204 Differential Revision: D40282205 fbshipit-source-id: e7888c17ecf5ddfb1d6beb539122f844a674230e
1 parent d9c3189 commit f77c2e5

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ edition = "2021"
1010
[dependencies]
1111
smallvec = { version = "1.9.0", features = ["const_generics"] }
1212
disjoint-sets = "0.4.2"
13-
im = "14.2.0"
13+
im = "15.1.0"
1414
petgraph = "0.6.2"
1515
sparta-proc-macros = { path = "../rust-proc-macros", version = "0.1.0" }
1616

rust/src/datatype/abstract_environment.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,8 @@ where
222222
match (lhs, rhs) {
223223
(Value(l_map), Value(ref mut r_map)) => {
224224
l_map.retain(|l_k, _| r_map.contains_key(l_k));
225-
226-
// NOTE: implcit prerequisite: key() and iter_mut() get the same order for the same map.
227-
// When `im` crate upgrades to 15.1, we could simply use iter_mut() as it will get both
228-
// keys and values.
229-
let r_vs: Vec<_> = l_map.keys().map(|l_k| r_map.remove(l_k).unwrap()).collect();
230-
for (l_v, r_v) in l_map.iter_mut().zip(r_vs) {
225+
for (l_k, l_v) in l_map.iter_mut() {
226+
let r_v = r_map.remove(l_k).unwrap();
231227
operation(l_v, r_v);
232228
}
233229
l_map.retain(|_, l_v| !l_v.is_top());

rust/src/datatype/abstract_partition.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,8 @@ where
238238
(_, Top) => {}
239239
(Value(l_map), Value(mut r_map)) => {
240240
l_map.retain(|l_k, _| r_map.contains_key(l_k));
241-
242-
let r_vs: Vec<_> = l_map.keys().map(|l_k| r_map.remove(l_k).unwrap()).collect();
243-
for (l_v, r_v) in l_map.iter_mut().zip(r_vs) {
241+
for (l_k, l_v) in l_map.iter_mut() {
242+
let r_v = r_map.remove(l_k).unwrap();
244243
operation(l_v, r_v);
245244
}
246245

0 commit comments

Comments
 (0)