Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Fix DBG_ShouldCheckStackAlignment.
Browse files Browse the repository at this point in the history
  • Loading branch information
adityamandaleeka committed Feb 17, 2016
1 parent 4125345 commit 82472d0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/pal/src/misc/dbgmsg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,18 @@ bool DBG_ShouldCheckStackAlignment()

if (caMode == CheckAlignment_Uninitialized)
{
char* checkAlignmentSettings = EnvironGetenv(PAL_CHECK_ALIGNMENT_MODE);
char* checkAlignmentSettings;
if (palEnvironment == nullptr)
{
// This function might be called before the PAL environment is initialized.
// In this case, use the system getenv instead.
checkAlignmentSettings = ::getenv(PAL_CHECK_ALIGNMENT_MODE);
}
else
{
checkAlignmentSettings = EnvironGetenv(PAL_CHECK_ALIGNMENT_MODE);
}

caMode = checkAlignmentSettings ?
(CheckAlignmentMode)atoi(checkAlignmentSettings) : CheckAlignment_Default;

Expand Down

0 comments on commit 82472d0

Please sign in to comment.