Fix a small regression impacting MSVC debug builds (#285)

* decomp: Fix nonempty_intersection impl for MSVC Debugging use-case

* docs: Add info on getting ASan builds running on Visual Studio w/o exceptions
This commit is contained in:
Tyler Wilding
2021-02-27 10:38:04 -08:00
committed by GitHub
parent b7f040986e
commit 049489c85b
2 changed files with 15 additions and 5 deletions
+8
View File
@@ -12,11 +12,14 @@
- [Table of Contents](#table-of-contents)
- [Project Description](#project-description)
- [Getting Started - Linux (Ubuntu)](#getting-started---linux-ubuntu)
- [Getting Started - Linux (Arch)](#getting-started---linux-arch)
- [Getting Started - Nixpkgs](#getting-started---nixpkgs)
- [Getting Started - Windows](#getting-started---windows)
- [Project Layout](#project-layout)
- [Directory Layout](#directory-layout)
- [More Documentation](#more-documentation)
- [ASan Build](#asan-build)
- [On Windows / Visual Studio](#on-windows--visual-studio)
<!-- tocstop -->
## Project Description
@@ -236,3 +239,8 @@ You will have to delete the build folder when changing compilers. When running
```
Then you can run the tests, runtime, and compiler as normal and they will abort if ASan finds an error.
### On Windows / Visual Studio
Until 16.9 Preview 4, when attaching a debugger to the ASan build, you must disable breaking on Win32 Access Violation exceptions. See the relevant section `Debugging - Exceptions` here https://devblogs.microsoft.com/cppblog/asan-for-windows-x64-and-debug-build-support/#known-issues
+7 -5
View File
@@ -110,10 +110,12 @@ Form* FormStack::pop_reg(const Variable& var,
namespace {
bool nonempty_intersection(const RegSet& a, const RegSet& b) {
// todo - if we ever switch to bit reg sets, this could be a lot faster.
std::vector<Register> isect;
std::set_intersection(a.begin(), a.end(), b.begin(), b.end(), std::back_inserter(isect));
return !isect.empty();
for (auto x : a) {
if (b.find(x) != b.end()) {
return true;
}
}
return false;
}
} // namespace
@@ -378,4 +380,4 @@ std::vector<FormElement*> rewrite_to_get_var(FormStack& stack,
return default_result;
}
} // namespace decompiler
} // namespace decompiler