Skip to content

Commit

Permalink
[MERGE #3646 @LouisLaf] OS#13255723, OS#13255732, OS#13255734, OS#132…
Browse files Browse the repository at this point in the history
…55735, OS#13255737: A few more uninitialized locals.

Merge pull request #3646 from LouisLaf:uninit

Fixed a few more benign cases.
  • Loading branch information
LouisLaf committed Sep 6, 2017
2 parents e35eca1 + b2e4402 commit 7bf217a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
6 changes: 5 additions & 1 deletion lib/Backend/GlobOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7507,7 +7507,11 @@ GlobOpt::TypeSpecializeInlineBuiltInBinary(IR::Instr **pInstr, Value *src1Val, V
if(src1Val->GetValueInfo()->IsLikelyInt() && src2Val->GetValueInfo()->IsLikelyInt())
{
// Compute resulting range info
int32 min1, max1, min2, max2, newMin, newMax;
int32 min1 = INT32_MIN;
int32 max1 = INT32_MAX;
int32 min2 = INT32_MIN;
int32 max2 = INT32_MAX;
int32 newMin, newMax;

Assert(this->DoAggressiveIntTypeSpec());
src1Val->GetValueInfo()->GetIntValMinMax(&min1, &max1, this->DoAggressiveIntTypeSpec());
Expand Down
6 changes: 3 additions & 3 deletions lib/Backend/IntBounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void IntBounds::SetBound(

// Aggressively merge the constant lower or upper bound of the base value, adjusted by the offset
ValueInfo const * const baseValueInfo = baseValue->GetValueInfo();
int constantBoundBase;
int constantBoundBase = 0xCCCCCCCC;
const bool success =
Lower
? baseValueInfo->TryGetIntConstantLowerBound(&constantBoundBase, true)
Expand Down Expand Up @@ -342,7 +342,7 @@ bool IntBounds::IsGreaterThanOrEqualTo(const Value *const value, const int offse
Assert(value);

ValueInfo const * const valueInfo = value->GetValueInfo();
int constantBoundBase;
int constantBoundBase = INT32_MAX;
const bool success = valueInfo->TryGetIntConstantUpperBound(&constantBoundBase, true);
Assert(success);
if(IsGreaterThanOrEqualTo(constantBoundBase, offset))
Expand All @@ -360,7 +360,7 @@ bool IntBounds::IsLessThanOrEqualTo(const Value *const value, const int offset)
Assert(value);

ValueInfo const * const valueInfo = value->GetValueInfo();
int constantBoundBase;
int constantBoundBase = INT32_MIN;
const bool success = valueInfo->TryGetIntConstantLowerBound(&constantBoundBase, true);
Assert(success);
if(IsLessThanOrEqualTo(constantBoundBase, offset))
Expand Down
2 changes: 1 addition & 1 deletion lib/Backend/Sym.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ StackSym::GetIntConstValue() const
{
return Js::TaggedInt::ToInt32(var);
}
int32 value;
int32 value = 0xCCCCCCCC;
const bool isInt32 = Js::JavascriptNumber::TryGetInt32Value(Js::JavascriptNumber::GetValue(var), &value);
Assert(isInt32);
return value;
Expand Down
5 changes: 4 additions & 1 deletion lib/Backend/ValueInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,10 @@ ValueInfo::MergeLikelyIntValueInfo(JitArenaAllocator* alloc, Value *toDataVal, V

if(newValueType.IsInt())
{
int32 min1, max1, min2, max2;
int32 min1 = INT32_MIN;
int32 max1 = INT32_MAX;
int32 min2 = INT32_MIN;
int32 max2 = INT32_MAX;
toDataValueInfo->GetIntValMinMax(&min1, &max1, false);
fromDataValueInfo->GetIntValMinMax(&min2, &max2, false);
return ValueInfo::NewIntRangeValueInfo(alloc, min(min1, min2), max(max1, max2), wasNegativeZeroPreventedByBailout);
Expand Down

0 comments on commit 7bf217a

Please sign in to comment.