Skip to content

Commit ab927a4

Browse files
committed
CHB:VARINV: filter fact comparison based on variable index
1 parent 1edaaa1 commit ab927a4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

CodeHawk/CHB/bchlib/bCHLocationVarInvariant.ml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
------------------------------------------------------------------------------
55
The MIT License (MIT)
66
7-
Copyright (c) 2022-2024 Aarno Labs LLC
7+
Copyright (c) 2022-2025 Aarno Labs LLC
88
99
Permission is hereby granted, free of charge, to any person obtaining a copy
1010
of this software and associated documentation files (the "Software"), to deal
@@ -197,11 +197,13 @@ object (self)
197197
H.iter
198198
(fun _ (var, locs) ->
199199
let locs = List.sort Stdlib.compare locs#toList in
200-
self#add_fact (DefUseHigh (var,locs))) usehighlocs
200+
self#add_fact (DefUseHigh (var, locs))) usehighlocs
201201
end
202202

203203
method get_var_facts (var: variable_t): var_invariant_int list =
204-
List.filter (fun f -> f#get_variable#equal var) self#get_facts
204+
let varix = var#getName#getSeqNumber in
205+
List.filter (fun f ->
206+
f#get_variable#getName#getSeqNumber = varix) self#get_facts
205207

206208
method get_var_reaching_defs (var: variable_t): var_invariant_int list =
207209
List.filter (fun f -> f#is_reaching_def) (self#get_var_facts var)

0 commit comments

Comments
 (0)