]>
Commit | Line | Data |
---|---|---|
09bea584 DM |
1 | 2020-01-31 David Malcolm <dmalcolm@redhat.com> |
2 | ||
3 | PR analyzer/93373 | |
4 | * region-model.cc (ASSERT_COMPAT_TYPES): Convert to... | |
5 | (assert_compat_types): ...this, and bail when either type is NULL, | |
6 | or when VOID_TYPE_P (dst_type). | |
7 | (region_model::get_lvalue): Update for above conversion. | |
8 | (region_model::get_rvalue): Likewise. | |
9 | ||
f1c807e8 DM |
10 | 2020-01-31 David Malcolm <dmalcolm@redhat.com> |
11 | ||
12 | PR analyzer/93379 | |
13 | * region-model.cc (region_model::update_for_return_superedge): | |
14 | Move check for null result so that it also guards setting the | |
15 | lhs. | |
16 | ||
455f58ec DM |
17 | 2020-01-31 David Malcolm <dmalcolm@redhat.com> |
18 | ||
19 | PR analyzer/93438 | |
20 | * region-model.cc (stack_region::can_merge_p): Split into a two | |
21 | pass approach, creating all stack regions first, then populating | |
22 | them. | |
23 | (selftest::test_state_merging): Add test coverage for (a) the case | |
24 | of self-merging a model in which a local in an older stack frame | |
25 | points to a local in a more recent stack frame (which previously | |
26 | would ICE), and (b) the case of self-merging a model in which a | |
27 | local points to a global (which previously worked OK). | |
28 | ||
182ce042 DM |
29 | 2020-01-31 David Malcolm <dmalcolm@redhat.com> |
30 | ||
31 | * analyzer.cc (is_named_call_p): Replace tests for fndecl being | |
32 | extern at file scope and having a non-NULL DECL_NAME with a call | |
33 | to maybe_special_function_p. | |
34 | * function-set.cc (function_set::contains_decl_p): Add call to | |
35 | maybe_special_function_p. | |
36 | ||
45eb3e49 DM |
37 | 2020-01-31 David Malcolm <dmalcolm@redhat.com> |
38 | ||
39 | PR analyzer/93450 | |
40 | * constraint-manager.cc | |
41 | (constraint_manager::get_or_add_equiv_class): Only compare constants | |
42 | if their types are compatible. | |
43 | * region-model.cc (constant_svalue::eval_condition): Replace check | |
44 | for identical types with call to types_compatible_p. | |
45 | ||
42f36563 DM |
46 | 2020-01-30 David Malcolm <dmalcolm@redhat.com> |
47 | ||
48 | * program-state.cc (extrinsic_state::dump_to_pp): New. | |
49 | (extrinsic_state::dump_to_file): New. | |
50 | (extrinsic_state::dump): New. | |
51 | * program-state.h (extrinsic_state::dump_to_pp): New decl. | |
52 | (extrinsic_state::dump_to_file): New decl. | |
53 | (extrinsic_state::dump): New decl. | |
54 | * sm.cc: Include "pretty-print.h". | |
55 | (state_machine::dump_to_pp): New. | |
56 | * sm.h (state_machine::dump_to_pp): New decl. | |
57 | ||
ebe9174e DM |
58 | 2020-01-30 David Malcolm <dmalcolm@redhat.com> |
59 | ||
60 | * diagnostic-manager.cc (for_each_state_change): Use | |
61 | extrinsic_state::get_num_checkers rather than accessing m_checkers | |
62 | directly. | |
63 | * program-state.cc (program_state::program_state): Likewise. | |
64 | * program-state.h (extrinsic_state::m_checkers): Make private. | |
65 | ||
e978955d DM |
66 | 2020-01-30 David Malcolm <dmalcolm@redhat.com> |
67 | ||
68 | PR analyzer/93356 | |
69 | * region-model.cc (region_model::eval_condition): In both | |
70 | overloads, bail out immediately on floating-point types. | |
71 | (region_model::eval_condition_without_cm): Likewise. | |
72 | (region_model::add_constraint): Likewise. | |
73 | ||
d177c49c DM |
74 | 2020-01-30 David Malcolm <dmalcolm@redhat.com> |
75 | ||
76 | PR analyzer/93450 | |
77 | * program-state.cc (sm_state_map::set_state): For the overload | |
78 | taking an svalue_id, bail out if the set_state on the ec does | |
79 | nothing. Convert the latter's return type from void to bool, | |
80 | returning true if anything changed. | |
81 | (sm_state_map::impl_set_state): Convert the return type from void | |
82 | to bool, returning true if the state changed. | |
83 | * program-state.h (sm_state_map::set_state): Convert return type | |
84 | from void to bool. | |
85 | (sm_state_map::impl_set_state): Likewise. | |
86 | * region-model.cc (constant_svalue::eval_condition): Only call | |
87 | fold_build2 if the types are the same. | |
88 | ||
7892ff37 JJ |
89 | 2020-01-29 Jakub Jelinek <jakub@redhat.com> |
90 | ||
91 | * analyzer.h (PUSH_IGNORE_WFORMAT, POP_IGNORE_WFORMAT): Remove. | |
92 | * constraint-manager.cc: Include diagnostic-core.h before graphviz.h. | |
93 | (range::dump, equiv_class::print): Don't use PUSH_IGNORE_WFORMAT or | |
94 | POP_IGNORE_WFORMAT. | |
95 | * state-purge.cc: Include diagnostic-core.h before | |
96 | gimple-pretty-print.h. | |
97 | (state_purge_annotator::add_node_annotations, print_vec_of_names): | |
98 | Don't use PUSH_IGNORE_WFORMAT or POP_IGNORE_WFORMAT. | |
99 | * region-model.cc: Move diagnostic-core.h include before graphviz.h. | |
100 | (path_var::dump, svalue::print, constant_svalue::print_details, | |
101 | region::dump_to_pp, region::dump_child_label, region::print_fields, | |
102 | map_region::print_fields, map_region::dump_dot_to_pp, | |
103 | map_region::dump_child_label, array_region::print_fields, | |
104 | array_region::dump_dot_to_pp): Don't use PUSH_IGNORE_WFORMAT or | |
105 | POP_IGNORE_WFORMAT. | |
106 | ||
5aebfb71 DM |
107 | 2020-01-28 David Malcolm <dmalcolm@redhat.com> |
108 | ||
109 | PR analyzer/93316 | |
110 | * engine.cc (rewind_info_t::update_model): Get the longjmp call | |
111 | stmt via get_longjmp_call () rather than assuming it is the last | |
112 | stmt in the longjmp's supernode. | |
113 | (rewind_info_t::add_events_to_path): Get the location_t for the | |
114 | rewind_from_longjmp_event via get_longjmp_call () rather than from | |
115 | the supernode's get_end_location (). | |
116 | ||
6c8e5844 DM |
117 | 2020-01-28 David Malcolm <dmalcolm@redhat.com> |
118 | ||
119 | * region-model.cc (poisoned_value_diagnostic::emit): Update for | |
120 | renaming of warning_at overload to warning_meta. | |
121 | * sm-file.cc (file_leak::emit): Likewise. | |
122 | * sm-malloc.cc (double_free::emit): Likewise. | |
123 | (possible_null_deref::emit): Likewise. | |
124 | (possible_null_arg::emit): Likewise. | |
125 | (null_deref::emit): Likewise. | |
126 | (null_arg::emit): Likewise. | |
127 | (use_after_free::emit): Likewise. | |
128 | (malloc_leak::emit): Likewise. | |
129 | (free_of_non_heap::emit): Likewise. | |
130 | * sm-sensitive.cc (exposure_through_output_file::emit): Likewise. | |
131 | * sm-signal.cc (signal_unsafe_call::emit): Likewise. | |
132 | * sm-taint.cc (tainted_array_index::emit): Likewise. | |
133 | ||
8c08c983 DM |
134 | 2020-01-27 David Malcolm <dmalcolm@redhat.com> |
135 | ||
136 | PR analyzer/93451 | |
137 | * region-model.cc (tree_cmp): For the REAL_CST case, impose an | |
138 | arbitrary order on NaNs relative to other NaNs and to non-NaNs; | |
139 | const-correctness tweak. | |
140 | (ana::selftests::build_real_cst_from_string): New function. | |
141 | (ana::selftests::append_interesting_constants): New function. | |
142 | (ana::selftests::test_tree_cmp_on_constants): New test. | |
143 | (ana::selftests::test_canonicalization_4): New test. | |
144 | (ana::selftests::analyzer_region_model_cc_tests): Call the new | |
145 | tests. | |
146 | ||
2fbea419 DM |
147 | 2020-01-27 David Malcolm <dmalcolm@redhat.com> |
148 | ||
149 | PR analyzer/93349 | |
150 | * engine.cc (run_checkers): Save and restore input_location. | |
151 | ||
6a81cabc DM |
152 | 2020-01-27 David Malcolm <dmalcolm@redhat.com> |
153 | ||
154 | * call-string.cc (call_string::cmp_1): Delete, moving body to... | |
155 | (call_string::cmp): ...here. | |
156 | * call-string.h (call_string::cmp_1): Delete decl. | |
157 | * engine.cc (worklist::key_t::cmp_1): Delete, moving body to... | |
158 | (worklist::key_t::cmp): ...here. Implement hash comparisons | |
159 | via comparison rather than subtraction to avoid overflow issues. | |
160 | * exploded-graph.h (worklist::key_t::cmp_1): Delete decl. | |
161 | * region-model.cc (tree_cmp): Eliminate buggy checking for | |
162 | symmetry. | |
163 | ||
342e14ff DM |
164 | 2020-01-27 David Malcolm <dmalcolm@redhat.com> |
165 | ||
166 | * analyzer.cc (is_named_call_p): Check that fndecl is "extern" | |
167 | and at file scope. Potentially disregard prefix _ or __ in | |
168 | fndecl's name. Bail if the identifier is NULL. | |
169 | (is_setjmp_call_p): Expect a gcall rather than plain gimple. | |
170 | Remove special-case check for leading prefix, and also check for | |
171 | sigsetjmp. | |
172 | (is_longjmp_call_p): Also check for siglongjmp. | |
173 | (get_user_facing_name): New function. | |
174 | * analyzer.h (is_setjmp_call_p): Expect a gcall rather than plain | |
175 | gimple. | |
176 | (get_user_facing_name): New decl. | |
177 | * checker-path.cc (setjmp_event::get_desc): Use | |
178 | get_user_facing_name to avoid hardcoding the function name. | |
179 | (rewind_event::rewind_event): Add rewind_info param, using it to | |
180 | initialize new m_rewind_info field, and strengthen the assertion. | |
181 | (rewind_from_longjmp_event::get_desc): Use get_user_facing_name to | |
182 | avoid hardcoding the function name. | |
183 | (rewind_to_setjmp_event::get_desc): Likewise. | |
184 | * checker-path.h (setjmp_event::setjmp_event): Add setjmp_call | |
185 | param and use it to initialize... | |
186 | (setjmp_event::m_setjmp_call): New field. | |
187 | (rewind_event::rewind_event): Add rewind_info param. | |
188 | (rewind_event::m_rewind_info): New protected field. | |
189 | (rewind_from_longjmp_event::rewind_from_longjmp_event): Add | |
190 | rewind_info param. | |
191 | (class rewind_to_setjmp_event): Move rewind_info field to parent | |
192 | class. | |
193 | * diagnostic-manager.cc (diagnostic_manager::add_events_for_eedge): | |
194 | Update setjmp-handling for is_setjmp_call_p requiring a gcall; | |
195 | pass the call to the new setjmp_event. | |
196 | * engine.cc (exploded_node::on_stmt): Update for is_setjmp_call_p | |
197 | requiring a gcall. | |
198 | (stale_jmp_buf::emit): Use get_user_facing_name to avoid | |
199 | hardcoding the function names. | |
200 | (exploded_node::on_longjmp): Pass the longjmp_call when | |
201 | constructing rewind_info. | |
202 | (rewind_info_t::add_events_to_path): Pass the rewind_info_t to the | |
203 | rewind_from_longjmp_event's ctor. | |
204 | * exploded-graph.h (rewind_info_t::rewind_info_t): Add | |
205 | longjmp_call param. | |
206 | (rewind_info_t::get_longjmp_call): New. | |
207 | (rewind_info_t::m_longjmp_call): New. | |
208 | * region-model.cc (region_model::on_setjmp): Update comment to | |
209 | indicate this is also for sigsetjmp. | |
210 | * region-model.h (struct setjmp_record): Likewise. | |
211 | (class setjmp_svalue): Likewise. | |
212 | ||
26d949c8 DM |
213 | 2020-01-27 David Malcolm <dmalcolm@redhat.com> |
214 | ||
215 | PR analyzer/93276 | |
216 | * analyzer.h (PUSH_IGNORE_WFORMAT, POP_IGNORE_WFORMAT): Guard these | |
217 | macros with GCC_VERSION >= 4006, making them no-op otherwise. | |
218 | * engine.cc (exploded_edge::exploded_edge): Specify template for | |
219 | base class initializer. | |
220 | (exploded_graph::add_edge): Specify template when chaining up to | |
221 | base class add_edge implementation. | |
222 | (viz_callgraph_node::dump_dot): Drop redundant "typename". | |
223 | (viz_callgraph_edge::viz_callgraph_edge): Specify template for | |
224 | base class initializer. | |
225 | * program-state.cc (sm_state_map::clone_with_remapping): Drop | |
226 | redundant "typename". | |
227 | (sm_state_map::print): Likewise. | |
228 | (sm_state_map::hash): Likewise. | |
229 | (sm_state_map::operator==): Likewise. | |
230 | (sm_state_map::remap_svalue_ids): Likewise. | |
231 | (sm_state_map::on_svalue_purge): Likewise. | |
232 | (sm_state_map::validate): Likewise. | |
233 | * program-state.h (sm_state_map::iterator_t): Likewise. | |
234 | * supergraph.h (superedge::superedge): Specify template for base | |
235 | class initializer. | |
236 | ||
648796da DM |
237 | 2020-01-23 David Malcolm <dmalcolm@redhat.com> |
238 | ||
239 | PR analyzer/93375 | |
240 | * supergraph.cc (callgraph_superedge::get_arg_for_parm): Fail | |
241 | gracefully is the number of parameters at the callee exceeds the | |
242 | number of arguments at the call stmt. | |
243 | (callgraph_superedge::get_parm_for_arg): Likewise. | |
244 | ||
591b59eb DM |
245 | 2020-01-22 David Malcolm <dmalcolm@redhat.com> |
246 | ||
247 | PR analyzer/93382 | |
248 | * program-state.cc (sm_state_map::on_svalue_purge): If the | |
249 | entry survives, but the origin is being purged, then reset the | |
250 | origin to null. | |
251 | ||
c9c8aef4 DM |
252 | 2020-01-22 David Malcolm <dmalcolm@redhat.com> |
253 | ||
254 | * sm-signal.cc: Fix nesting of CHECKING_P and namespace ana. | |
255 | ||
fd9982bb DM |
256 | 2020-01-22 David Malcolm <dmalcolm@redhat.com> |
257 | ||
258 | PR analyzer/93378 | |
259 | * engine.cc (setjmp_svalue::compare_fields): Update for | |
260 | replacement of m_enode with m_setjmp_record. | |
261 | (setjmp_svalue::add_to_hash): Likewise. | |
262 | (setjmp_svalue::get_index): Rename... | |
263 | (setjmp_svalue::get_enode_index): ...to this. | |
264 | (setjmp_svalue::print_details): Update for replacement of m_enode | |
265 | with m_setjmp_record. | |
266 | (exploded_node::on_longjmp): Likewise. | |
267 | * exploded-graph.h (rewind_info_t::m_enode_origin): Replace... | |
268 | (rewind_info_t::m_setjmp_record): ...with this. | |
269 | (rewind_info_t::rewind_info_t): Update for replacement of m_enode | |
270 | with m_setjmp_record. | |
271 | (rewind_info_t::get_setjmp_point): Likewise. | |
272 | (rewind_info_t::get_setjmp_call): Likewise. | |
273 | * region-model.cc (region_model::dump_summary_of_map): Likewise. | |
274 | (region_model::on_setjmp): Likewise. | |
275 | * region-model.h (struct setjmp_record): New struct. | |
276 | (setjmp_svalue::m_enode): Replace... | |
277 | (setjmp_svalue::m_setjmp_record): ...with this. | |
278 | (setjmp_svalue::setjmp_svalue): Update for replacement of m_enode | |
279 | with m_setjmp_record. | |
280 | (setjmp_svalue::clone): Likewise. | |
281 | (setjmp_svalue::get_index): Rename... | |
282 | (setjmp_svalue::get_enode_index): ...to this. | |
283 | (setjmp_svalue::get_exploded_node): Replace... | |
284 | (setjmp_svalue::get_setjmp_record): ...with this. | |
285 | ||
da7cf663 DM |
286 | 2020-01-22 David Malcolm <dmalcolm@redhat.com> |
287 | ||
288 | PR analyzer/93316 | |
289 | * analyzer.cc (is_setjmp_call_p): Check for "setjmp" as well as | |
290 | "_setjmp". | |
291 | ||
75038aa6 DM |
292 | 2020-01-22 David Malcolm <dmalcolm@redhat.com> |
293 | ||
294 | PR analyzer/93307 | |
295 | * analysis-plan.h: Wrap everything namespace "ana". | |
296 | * analyzer-logging.cc: Likewise. | |
297 | * analyzer-logging.h: Likewise. | |
298 | * analyzer-pass.cc (pass_analyzer::execute): Update for "ana" | |
299 | namespace. | |
300 | * analyzer-selftests.cc: Wrap everything namespace "ana". | |
301 | * analyzer-selftests.h: Likewise. | |
302 | * analyzer.h: Likewise for forward decls of types. | |
303 | * call-string.h: Likewise. | |
304 | * checker-path.cc: Likewise. | |
305 | * checker-path.h: Likewise. | |
306 | * constraint-manager.cc: Likewise. | |
307 | * constraint-manager.h: Likewise. | |
308 | * diagnostic-manager.cc: Likewise. | |
309 | * diagnostic-manager.h: Likewise. | |
310 | * engine.cc: Likewise. | |
311 | * engine.h: Likewise. | |
312 | * exploded-graph.h: Likewise. | |
313 | * function-set.cc: Likewise. | |
314 | * function-set.h: Likewise. | |
315 | * pending-diagnostic.cc: Likewise. | |
316 | * pending-diagnostic.h: Likewise. | |
317 | * program-point.cc: Likewise. | |
318 | * program-point.h: Likewise. | |
319 | * program-state.cc: Likewise. | |
320 | * program-state.h: Likewise. | |
321 | * region-model.cc: Likewise. | |
322 | * region-model.h: Likewise. | |
323 | * sm-file.cc: Likewise. | |
324 | * sm-malloc.cc: Likewise. | |
325 | * sm-pattern-test.cc: Likewise. | |
326 | * sm-sensitive.cc: Likewise. | |
327 | * sm-signal.cc: Likewise. | |
328 | * sm-taint.cc: Likewise. | |
329 | * sm.cc: Likewise. | |
330 | * sm.h: Likewise. | |
331 | * state-purge.h: Likewise. | |
332 | * supergraph.cc: Likewise. | |
333 | * supergraph.h: Likewise. | |
334 | ||
4f01e577 DM |
335 | 2020-01-21 David Malcolm <dmalcolm@redhat.com> |
336 | ||
337 | PR analyzer/93352 | |
338 | * region-model.cc (int_cmp): Rename to... | |
339 | (array_region::key_cmp): ...this, using key_t rather than int. | |
340 | Rewrite in terms of comparisons rather than subtraction to | |
341 | ensure qsort is anti-symmetric when handling extreme values. | |
342 | (array_region::walk_for_canonicalization): Update for above | |
343 | renaming. | |
344 | * region-model.h (array_region::key_cmp): New decl. | |
345 | ||
07c86323 DM |
346 | 2020-01-17 David Malcolm <dmalcolm@redhat.com> |
347 | ||
348 | PR analyzer/93290 | |
349 | * region-model.cc (region_model::eval_condition_without_cm): Avoid | |
350 | gcc_unreachable for unexpected operations for the case where | |
351 | we're comparing an svalue against itself. | |
352 | ||
5f030383 DM |
353 | 2020-01-17 David Malcolm <dmalcolm@redhat.com> |
354 | ||
355 | PR analyzer/93281 | |
356 | * region-model.cc | |
357 | (region_model::convert_byte_offset_to_array_index): Convert to | |
358 | ssizetype before dividing by byte_size. Use fold_binary rather | |
359 | than fold_build2 to avoid needlessly constructing a tree for the | |
360 | non-const case. | |
361 | ||
49e9a999 DM |
362 | 2020-01-15 David Malcolm <dmalcolm@redhat.com> |
363 | ||
364 | * engine.cc (class impl_region_model_context): Fix comment. | |
365 | ||
32077b69 DM |
366 | 2020-01-14 David Malcolm <dmalcolm@redhat.com> |
367 | ||
368 | PR analyzer/93212 | |
369 | * region-model.cc (make_region_for_type): Use | |
370 | FUNC_OR_METHOD_TYPE_P rather than comparing against FUNCTION_TYPE. | |
371 | * region-model.h (function_region::function_region): Likewise. | |
372 | ||
7fb3669e DM |
373 | 2020-01-14 David Malcolm <dmalcolm@redhat.com> |
374 | ||
375 | * program-state.cc (sm_state_map::clone_with_remapping): Copy | |
376 | m_global_state. | |
377 | (selftest::test_program_state_merging_2): New selftest. | |
378 | (selftest::analyzer_program_state_cc_tests): Call it. | |
379 | ||
e2a538b1 DM |
380 | 2020-01-14 David Malcolm <dmalcolm@redhat.com> |
381 | ||
382 | * checker-path.h (checker_path::get_checker_event): New function. | |
383 | (checker_path): Add DISABLE_COPY_AND_ASSIGN; make fields private. | |
384 | * diagnostic-manager.cc | |
385 | (diagnostic_manager::prune_for_sm_diagnostic): Replace direct | |
386 | access to checker_path::m_events with accessor functions. Fix | |
387 | overlong line. | |
388 | (diagnostic_manager::prune_interproc_events): Replace direct | |
389 | access to checker_path::m_events with accessor functions. | |
390 | (diagnostic_manager::finish_pruning): Likewise. | |
391 | ||
94946989 DM |
392 | 2020-01-14 David Malcolm <dmalcolm@redhat.com> |
393 | ||
394 | * checker-path.h (checker_event::clone): Delete vfunc decl. | |
395 | (debug_event::clone): Delete vfunc impl. | |
396 | (custom_event::clone): Delete vfunc impl. | |
397 | (statement_event::clone): Delete vfunc impl. | |
398 | (function_entry_event::clone): Delete vfunc impl. | |
399 | (state_change_event::clone): Delete vfunc impl. | |
400 | (start_cfg_edge_event::clone): Delete vfunc impl. | |
401 | (end_cfg_edge_event::clone): Delete vfunc impl. | |
402 | (call_event::clone): Delete vfunc impl. | |
403 | (return_event::clone): Delete vfunc impl. | |
404 | (setjmp_event::clone): Delete vfunc impl. | |
405 | (rewind_from_longjmp_event::clone): Delete vfunc impl. | |
406 | (rewind_to_setjmp_event::clone): Delete vfunc impl. | |
407 | (warning_event::clone): Delete vfunc impl. | |
408 | ||
718930c0 DM |
409 | 2020-01-14 David Malcolm <dmalcolm@redhat.com> |
410 | ||
411 | * supergraph.cc (supernode::dump_dot): Ensure that the TABLE | |
412 | element has at least one TR. | |
413 | ||
8397af8e DM |
414 | 2020-01-14 David Malcolm <dmalcolm@redhat.com> |
415 | ||
416 | PR analyzer/58237 | |
417 | * engine.cc (leak_stmt_finder::find_stmt): Use get_pure_location | |
418 | when comparing against UNKNOWN_LOCATION. | |
419 | (stmt_requires_new_enode_p): Likewise. | |
420 | (exploded_graph::dump_exploded_nodes): Likewise. | |
421 | * supergraph.cc (supernode::get_start_location): Likewise. | |
422 | (supernode::get_end_location): Likewise. | |
423 | ||
697251b7 DM |
424 | 2020-01-14 David Malcolm <dmalcolm@redhat.com> |
425 | ||
426 | PR analyzer/58237 | |
427 | * analyzer-selftests.cc (selftest::run_analyzer_selftests): Call | |
428 | selftest::analyzer_sm_file_cc_tests. | |
429 | * analyzer-selftests.h (selftest::analyzer_sm_file_cc_tests): New | |
430 | decl. | |
431 | * sm-file.cc: Include "analyzer/function-set.h" and | |
432 | "analyzer/analyzer-selftests.h". | |
433 | (get_file_using_fns): New function. | |
434 | (is_file_using_fn_p): New function. | |
435 | (fileptr_state_machine::on_stmt): Return true for known functions. | |
436 | (selftest::analyzer_sm_file_cc_tests): New function. | |
437 | ||
4804c5fe DM |
438 | 2020-01-14 David Malcolm <dmalcolm@redhat.com> |
439 | ||
440 | * analyzer-selftests.cc (selftest::run_analyzer_selftests): Call | |
441 | selftest::analyzer_sm_signal_cc_tests. | |
442 | * analyzer-selftests.h (selftest::analyzer_sm_signal_cc_tests): | |
443 | New decl. | |
444 | * sm-signal.cc: Include "analyzer/function-set.h" and | |
445 | "analyzer/analyzer-selftests.h". | |
446 | (get_async_signal_unsafe_fns): New function. | |
447 | (signal_unsafe_p): Reimplement in terms of the above. | |
448 | (selftest::analyzer_sm_signal_cc_tests): New function. | |
449 | ||
a6b5f19c DM |
450 | 2020-01-14 David Malcolm <dmalcolm@redhat.com> |
451 | ||
452 | * analyzer-selftests.cc (selftest::run_analyzer_selftests): Call | |
453 | selftest::analyzer_function_set_cc_tests. | |
454 | * analyzer-selftests.h (selftest::analyzer_function_set_cc_tests): | |
455 | New decl. | |
456 | * function-set.cc: New file. | |
457 | * function-set.h: New file. | |
458 | ||
ef7827b0 DM |
459 | 2020-01-14 David Malcolm <dmalcolm@redhat.com> |
460 | ||
461 | * analyzer.h (fndecl_has_gimple_body_p): New decl. | |
462 | * engine.cc (impl_region_model_context::on_unknown_change): New | |
463 | function. | |
464 | (fndecl_has_gimple_body_p): Make non-static. | |
465 | (exploded_node::on_stmt): Treat __analyzer_dump_exploded_nodes as | |
466 | known. Track whether we have a call with unknown side-effects and | |
467 | pass it to on_call_post. | |
468 | * exploded-graph.h (impl_region_model_context::on_unknown_change): | |
469 | New decl. | |
470 | * program-state.cc (sm_state_map::on_unknown_change): New function. | |
471 | * program-state.h (sm_state_map::on_unknown_change): New decl. | |
472 | * region-model.cc: Include "bitmap.h". | |
473 | (region_model::on_call_pre): Return a bool, capturing whether the | |
474 | call has unknown side effects. | |
475 | (region_model::on_call_post): Add arg "bool unknown_side_effects" | |
476 | and if true, call handle_unrecognized_call. | |
477 | (class reachable_regions): New class. | |
478 | (region_model::handle_unrecognized_call): New function. | |
479 | * region-model.h (region_model::on_call_pre): Return a bool. | |
480 | (region_model::on_call_post): Add arg "bool unknown_side_effects". | |
481 | (region_model::handle_unrecognized_call): New decl. | |
482 | (region_model_context::on_unknown_change): New vfunc. | |
483 | (test_region_model_context::on_unknown_change): New function. | |
484 | ||
14f9d7b9 DM |
485 | 2020-01-14 David Malcolm <dmalcolm@redhat.com> |
486 | ||
487 | * diagnostic-manager.cc (saved_diagnostic::operator==): Move here | |
488 | from header. Replace pointer equality test on m_var with call to | |
489 | pending_diagnostic::same_tree_p. | |
490 | * diagnostic-manager.h (saved_diagnostic::operator==): Move to | |
491 | diagnostic-manager.cc. | |
492 | * pending-diagnostic.cc (pending_diagnostic::same_tree_p): New. | |
493 | * pending-diagnostic.h (pending_diagnostic::same_tree_p): New. | |
494 | * sm-file.cc (file_diagnostic::subclass_equal_p): Replace pointer | |
495 | equality on m_arg with call to pending_diagnostic::same_tree_p. | |
496 | * sm-malloc.cc (malloc_diagnostic::subclass_equal_p): Likewise. | |
497 | (possible_null_arg::subclass_equal_p): Likewise. | |
498 | (null_arg::subclass_equal_p): Likewise. | |
499 | (free_of_non_heap::subclass_equal_p): Likewise. | |
500 | * sm-pattern-test.cc (pattern_match::operator==): Likewise. | |
501 | * sm-sensitive.cc (exposure_through_output_file::operator==): | |
502 | Likewise. | |
503 | * sm-taint.cc (tainted_array_index::operator==): Likewise. | |
504 | ||
f474fbd5 DM |
505 | 2020-01-14 David Malcolm <dmalcolm@redhat.com> |
506 | ||
507 | * diagnostic-manager.cc (dedupe_winners::add): Add logging | |
508 | of deduplication decisions made. | |
509 | ||
757bf1df DM |
510 | 2020-01-14 David Malcolm <dmalcolm@redhat.com> |
511 | ||
512 | * ChangeLog: New file. | |
513 | * analyzer-selftests.cc: New file. | |
514 | * analyzer-selftests.h: New file. | |
515 | * analyzer.opt: New file. | |
516 | * analysis-plan.cc: New file. | |
517 | * analysis-plan.h: New file. | |
518 | * analyzer-logging.cc: New file. | |
519 | * analyzer-logging.h: New file. | |
520 | * analyzer-pass.cc: New file. | |
521 | * analyzer.cc: New file. | |
522 | * analyzer.h: New file. | |
523 | * call-string.cc: New file. | |
524 | * call-string.h: New file. | |
525 | * checker-path.cc: New file. | |
526 | * checker-path.h: New file. | |
527 | * constraint-manager.cc: New file. | |
528 | * constraint-manager.h: New file. | |
529 | * diagnostic-manager.cc: New file. | |
530 | * diagnostic-manager.h: New file. | |
531 | * engine.cc: New file. | |
532 | * engine.h: New file. | |
533 | * exploded-graph.h: New file. | |
534 | * pending-diagnostic.cc: New file. | |
535 | * pending-diagnostic.h: New file. | |
536 | * program-point.cc: New file. | |
537 | * program-point.h: New file. | |
538 | * program-state.cc: New file. | |
539 | * program-state.h: New file. | |
540 | * region-model.cc: New file. | |
541 | * region-model.h: New file. | |
542 | * sm-file.cc: New file. | |
543 | * sm-malloc.cc: New file. | |
544 | * sm-malloc.dot: New file. | |
545 | * sm-pattern-test.cc: New file. | |
546 | * sm-sensitive.cc: New file. | |
547 | * sm-signal.cc: New file. | |
548 | * sm-taint.cc: New file. | |
549 | * sm.cc: New file. | |
550 | * sm.h: New file. | |
551 | * state-purge.cc: New file. | |
552 | * state-purge.h: New file. | |
553 | * supergraph.cc: New file. | |
554 | * supergraph.h: New file. | |
555 | ||
556 | 2019-12-13 David Malcolm <dmalcolm@redhat.com> | |
557 | ||
558 | * Initial creation | |
559 | ||
560 | \f | |
561 | Copyright (C) 2019-2020 Free Software Foundation, Inc. | |
562 | ||
563 | Copying and distribution of this file, with or without modification, | |
564 | are permitted in any medium without royalty provided the copyright | |
565 | notice and this notice are preserved. |