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 committed Sep 29, 2017
1 parent d6ff9c9 commit d174120
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 d174120

Please sign in to comment.