Skip to content

Commit

Permalink
Merge pull request #470 from erichkeane/develop
Browse files Browse the repository at this point in the history
Change StaticObject instance management to hopefully avoid UBSAN
  • Loading branch information
AzothAmmo authored Mar 16, 2018
2 parents 9aa7f39 + e9234e3 commit 0cf8150
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions include/cereal/details/static_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,12 @@ namespace cereal
class CEREAL_DLL_EXPORT StaticObject
{
private:
//! Forces instantiation at pre-execution time
static void instantiate( T const * ) {}

static T & create()
{
static T t;
instantiate(&instance);
//! Forces instantiation at pre-execution time
(void)instance;
return t;
}

Expand Down

0 comments on commit 0cf8150

Please sign in to comment.