Skip to content

Commit

Permalink
[analyzer][NFC] Workaround miscompilation on recent MSVC
Browse files Browse the repository at this point in the history
SVal argument 'Cond' passed in is corrupted in release mode with
exception handling enabled (result in an UndefinedSVal), or changing
lambda capture inside the callee can workaround this.

Known problematic VS Versions:
- VS 2022 17.4.4
- VS 2022 17.5.4
- VS 2022 17.7.2

Verified working VS Version:
- VS 2019 16.11.25

Fixes #62130

Reviewed By: steakhal

Differential Revision: https://reviews.llvm.org/D159163
  • Loading branch information
danix800 committed Aug 30, 2023
1 parent 73e3866 commit 5b3f41c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/StaticAnalyzer/Core/ConstraintManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ ConstraintManager::assumeDualImpl(ProgramStateRef &State,

ConstraintManager::ProgramStatePair
ConstraintManager::assumeDual(ProgramStateRef State, DefinedSVal Cond) {
auto AssumeFun = [&](bool Assumption) {
auto AssumeFun = [&, Cond](bool Assumption) {
return assumeInternal(State, Cond, Assumption);
};
return assumeDualImpl(State, AssumeFun);
Expand Down

0 comments on commit 5b3f41c

Please sign in to comment.