Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
[Merge chakra-core/ChakraCore@965098b204] [MERGE #3835 @boingoing] Fi…
Browse files Browse the repository at this point in the history
…x null dereference in LoadAllConstants when code has no 'this' binding

Merge pull request #3835 from boingoing:FixEventHandlerThisBinding

Fixes https://microsoft.visualstudio.com/DefaultCollection/OS/_workitems?id=13977382&_a=edit
  • Loading branch information
chakrabot authored and kfarnung committed Jan 9, 2018
1 parent 60c004d commit 58fc3c7
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1929,7 +1929,10 @@ void ByteCodeGenerator::LoadAllConstants(FuncInfo *funcInfo)
byteCodeFunction->MapAndSetEnvRegister(funcInfo->GetEnvRegister());
if (funcInfo->GetIsTopLevelEventHandler())
{
byteCodeFunction->MapAndSetThisRegisterForEventHandler(funcInfo->GetThisSymbol()->GetLocation());
if (funcInfo->GetThisSymbol())
{
byteCodeFunction->MapAndSetThisRegisterForEventHandler(funcInfo->GetThisSymbol()->GetLocation());
}
// The environment is the namespace hierarchy starting with "this".
Assert(!funcInfo->RegIsConst(funcInfo->GetEnvRegister()));
thisLoadedFromParams = true;
Expand Down

0 comments on commit 58fc3c7

Please sign in to comment.