Skip to content

Commit

Permalink
Update the default constructor of CompareState to set a more useful e…
Browse files Browse the repository at this point in the history
…mpty state that won't segfault.
  • Loading branch information
jkoritzinsky committed Jul 14, 2023
1 parent 3a37f90 commit 28b3fd5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/coreclr/vm/siginfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3662,8 +3662,7 @@ MetaSig::CompareElementType(
}
CONTRACTL_END

TokenPairList tempList { nullptr };
CompareState temp{ &tempList };
CompareState temp{ };
if (state == NULL)
state = &temp;

Expand Down
5 changes: 4 additions & 1 deletion src/coreclr/vm/siginfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,10 @@ class MetaSig
// be compared.
bool IgnoreCustomModifiers;

CompareState() = default;
CompareState()
: Visited{ nullptr }
, IgnoreCustomModifiers{ false }
{ }

CompareState(TokenPairList* list)
: Visited{ list }
Expand Down

0 comments on commit 28b3fd5

Please sign in to comment.