checkedc / checkedc-llvm-project

This was a fork of Checked C clang used from 2021-2024. The changes have been merged into the original Checked C clang repo, which is now at https://github.com/checkedc/checkedc-clang.
https://www.checkedc.org
13 stars 19 forks source link

Fix non-deterministic output ordering in AvailableFactsAnalysis.cpp #752

Open secure-sw-dev-bot opened 2 years ago

secure-sw-dev-bot commented 2 years ago

This issue was copied from https://github.com/microsoft/checkedc-clang/issues/756


AvailableFactsAnalysis.cpp uses std::set as the main data structure for storing/iterating the collected facts. The implementation of std::set is platform specific. That’s the reason the test test/CheckedC/dump-dataflow-facts.c fails on Windows (but passes on Linux). On Windows X64, there are run-to-run differences in the output order of blocks and facts when I run this test by hand.

The fix will involve rethinking about the data structures used and sorting before printing.

secure-sw-dev-bot commented 2 years ago

Comment from @mgrang:

Test marked unsupported for Windows in https://github.com/microsoft/checkedc-clang/pull/757.