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

Commit

Permalink
deps: update ChakraCore to chakra-core/ChakraCore@99131a0f2c
Browse files Browse the repository at this point in the history
[1.8>1.9] [MERGE #4567 @meg-gupta] Loosen Globopt assert when called from HoistInvariantValueInfo

Merge pull request #4567 from meg-gupta:lossenGlobOptAssert

Fixes OS#15189393

Example:
```
  invariantSym = ..[]; // non object value type

  landingPad :

  loopTop :

     = LdElem[invariantSym + ...] // non-object value type in first pass, object value type in second pass
     = LdFld[invariantSym...] // object value type

  loopEnd
```
  invariantSym is invariant in this loop, for some reason if we fail to hoist the LdFld, then assert saying valueInfos are incompatible will fire, when we try to hoist the LdElem.
  Because optimization of LdFld will force combine the valuetype of invariantSym with Object, and in the second pass while optimizing LdElem in HoistInvariantValueInfo,
  we will call ChangeValueInfo and this assert will fire.
  This is because we are trying to change a non-object valuetype to an object valuetype.
  AreValueTypesCompatible function converts to definite valuetypes before checking if they are compatible.
  The check doesn't care if both of them are likely.

  Globopt calls ChangeValueInfo with allowIncompatiblyTypes set to false in most cases where we are transforming specific to generic/generic to specific like Typespecialization etc.
  It calls ChangeValueInfo with allowIncompatiblyTypes set to true, where we can expect incompatible types ex: UpdateObjPtrValueInfo.

  This fix calls ChangeValueInfo from HoistInvariantValueInfo with allowIncompatiblyTypes set to true.

Reviewed-By: chakrabot <chakrabot@users.noreply.github.com>
  • Loading branch information
meg-gupta authored and chakrabot committed Jan 18, 2018
1 parent 3571d06 commit c0b4721
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deps/chakrashim/core/lib/Backend/GlobOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17177,7 +17177,7 @@ GlobOpt::HoistInvariantValueInfo(
newValueInfo = invariantValueInfoToHoist->Copy(alloc);
this->SetSymStoreDirect(newValueInfo, symStore);
}
ChangeValueInfo(targetBlock, valueToUpdate, newValueInfo);
ChangeValueInfo(targetBlock, valueToUpdate, newValueInfo, true);
}

// static
Expand Down

0 comments on commit c0b4721

Please sign in to comment.