Skip to content

Instantly share code, notes, and snippets.

@trzecieu
Created January 29, 2019 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trzecieu/8ebe6a15a3a3759e7701888a3581cd62 to your computer and use it in GitHub Desktop.
Save trzecieu/8ebe6a15a3a3759e7701888a3581cd62 to your computer and use it in GitHub Desktop.
nullptr vtable vs2017
#include <functional>
struct Base {
virtual void f() const = 0;
};
int main() {
struct : public Base {
void f() const override {}
} a, b; // vTables of 'a' and 'b' contain nulls
// not crucial for problem, helps to emphasize problem
std::invoke(&Base::f, a);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment