Finding Bugs using Path-Sensitive Static AnalysisFinding Bugs using Path-Sensitive Static Analysis Gábor Horváth Gabor.Horvath@microsoft.com @XazaxHunWelcome to CppCon 2021! Join #visual_studio channel on CppCon Discord https://aka.ms/cppcon/discord latest announcements Take our survey https://aka.ms/cppconAgenda • Intro to path-sensitive static analysis • Path-sensitive checks in MSVC • A look under the hood • Upcoming features • Lessons learned2012 -> Unknown p -> Null p -> MaybeNull p -> MaybeNull Warning Unknown Null NotNull MaybeNull Analysis state Transition semi-lattice• Some paths are infeasible: • Not taking branch 1, but taking branch0 码力 | 35 页 | 14.13 MB | 6 月前3
Spreadsheet Analysis using Atlassian Tools0 码力 | 1 页 | 120.37 KB | 5 月前3
whats new in visual studioNavigation ☑️� Linters ☑️� Colorization & Formatting ☑️� IntelliSense ⌛; ☑️�MSVC ☑️�MSVC Code Analysis ☑️�MSBuild ; CMake ⌛ ; GCC ⌛ ; Clang/LLVM ⌛ ☑️�Stepping ☑️�Parallel Stacks ☑️�Debugger 4. Developer and Team Productivity Static Analysis ✴ New and improved checkers in MSVC Code Analysis • Returning a local variable with std::move • Path-sensitive bounds checking • Use-after-move • Lifetime Oct 28 – 4:45pm / Fri, Oct 29 – 12:00pm Finding bugs using path-sensitive static analysis Gabor Horvath – _3 Tue, Oct 26 – 3:15pm Static Analysis and Program Safety in C++: Making it Real Sunny Chatterjee0 码力 | 42 页 | 19.02 MB | 6 月前3
C++20's milliseconds; using time_point = time_point; static constexpr bool is_steady = false; static time_point now() {} }; static_assert(is_clock_v ); For a type T to qualify as a SYSTEM\CurrentControlSet\Control\LeapSecondInformation • For pre-2018 leap seconds, we maintain a static constexpr table to pull data from. • Note that we don’t currently have a way to detect upcoming October update). • However, because leap seconds happen infrequently, we plan to update this static table periodically so older OSes can still detect more recent leap seconds (they will just need 0 码力 | 55 页 | 8.67 MB | 6 月前3
ClickHouse: настоящее и будущееrecommendations Classifieds. Dating Search engine optimization Telecom traffic analysis DPI analysis CDR records analysis Fraud & spam detection DDoS protection Application performance monitoring Logs0 码力 | 32 页 | 2.62 MB | 1 年前3
基于 Rust Arrow Flight 的物联网和时序数据传输及转换工具 霍琳贺Sources • IoT Protocols • Streaming Pipeline • Transformer • Data Share • Visualization • Analysis Platform • High Avalibility 2022.12 2023.05 2023.09 Usability Functionality taosX - 集群运维 •0 码力 | 29 页 | 2.26 MB | 1 年前3
新一代分布式高性能图数据库的构建 - 沈游人AST Unresolved Logical Plan Logical Plan Optimized Logical Plan Physical Plan Program API Analysis rules Optimization rules: MATCH -> pushdown Planning Strategies Graph Execution Code Gen0 码力 | 38 页 | 24.68 MB | 1 年前3
Working with Asynchrony Generically: A Tour of C++ ExecutorsCONCURRENT WORK namespace ex = std::execution; int compute_intensive(int); int main() { unifex::static_thread_pool pool{8}; ex::scheduler auto sched = pool.get_scheduler(); ex::sender auto work = CONCURRENT WORK namespace ex = std::execution; int compute_intensive(int); int main() { unifex::static_thread_pool pool{8}; ex::scheduler auto sched = pool.get_scheduler(); ex::sender auto work = you want to. namespace ex = std::execution; int compute_intensive(int); int main() { unifex::static_thread_pool pool{8}; ex::scheduler auto sched = pool.get_scheduler(); ex::sender auto work =0 码力 | 121 页 | 7.73 MB | 6 月前3
C++高性能并行编程与优化 - 课件 - Zeno 中的现代 C++ 最佳实践 printf 而是别的比较复杂的表达式呢? • 可以用逗号表达式的特性,总是会返回后一个 值,例如 (x, y) 始终会返回 y ,哪怕 x 是 void 也没关系。因此只需要这样写就行: • static int helper = ( 任意表达式 , 0); 顺便一提: lambda 的妙用 • 小彭老师小技巧: • []{ xxx; yyy; return zzz; }() • 可以在表达式层面里插入一个语句块,本 • 1. 该类的构造函数一定在 main 之前执行 • 2. 该类的解构函数一定在 main 之后执行 • 该技巧可用于在程序退出时删除某些文件之类 。 • 这就是小彭老师的静态初始化 (static-init) 大法 。 静态初始化用于批量注册函数 • 我们可以定义一个全局的函数表(右图中的 functab ),然后利用小彭老师的静态初始化 大法,把这些函数在 main 之前就插入到全局 为了寻找思路,我们把眼光挪开全局的 static 变量,来看看函数的 static 变量吧 ! • 众所周知,函数体内声明为 static 的变量 即使函数退出后依然存在。 • 实际上函数的 static 变量也可以指定初始 化表达式,这个表达式会在第一次进入函 数时执行。注意:是第一次进入的时候执 行而不是单纯的在 main 函数之前执行哦 ! 如果函数体内的 static 变量是一个类呢?0 码力 | 54 页 | 3.94 MB | 1 年前3
C++高性能并行编程与优化 - 课件 - 04 从汇编角度看编译器优化!否则编译器看不见函数体里的内容怎么 内联呢? 为了效率我们可以尽量把常用函数定义在 头文件里,然后声明为 static 。这样调用 他们的时候编译器看得到他们的函数体, 从而有机会内联。 内联:当编译器看得到被调用函数( other )实现的时候 ,会直接把函数实现贴到调用他的函数( func )里。 局部可见函数: static 因为 static 声明表示不会暴露 other 给其 他文件,而且 func 也已经内联了 的函数体定义,就会自动内联 内联与否和 inline 没关系,内联与否只取决于是否在同文件,且函数体够小 要性能的,定义在头文件声明为 static 即可,没必要加 inline 的 static 纯粹是为了避免多个 .cpp 引用同一个头文件造成冲突,并不是必须 static 才内 联 如果你不确定某修改是否能提升性能,那你最好实际测一下,不要脑内模拟 inline 在现代 C++ 中有其他含义,但和内联没有关系,他是一个迷惑性的名字 函数里是什么,哪怕 other 在定义他的文件里是个空函数,他也不敢优化掉。 解决方案:放在同一个文件里 结论:避免在 for 循环体里调用外部函数,把他们移到 同一个文件里,或者放在头文件声明为 static 函数。 将 other 放到 和 func 同一个 .cpp 文件里,这样编译器看得到 other 的函 数体,就可以内联化该函数 循环中的下标:随机访问 矢量化失败! 循环中的下标:跳跃访问0 码力 | 108 页 | 9.47 MB | 1 年前3
共 23 条
- 1
- 2
- 3













