Stack overflow in KernelVersion parser

Summary: Caught by ASAN

Reviewed By: @ottoni

Differential Revision: D1651562

Signature: t1:1651562:1414731602:574aa61ef4b4538f26299f6694aff3c5e3bc317d
fix sandbox access logs

Summary: I broke this by moving the logging into teardownRequest without preserving sourceRootInfo.  Make this an Optional (eg: delayed construction) member and clear it after logging is complete.

Reviewed By: @markw65

Differential Revision: D1650759
Skip arbitrary number of 0xff padding bytes in JPEG

Summary: There's no reason to limit the number of 0xff padding bytes while trying
to parse JPEG. Let's remove the arbitrary limit of 26 and keep reading
the file and skipping them.

Reviewed By: @billf

Differential Revision: D1650960
Look for the least common ancestor when merging local values.

Summary: Right now we're looking for one value being the ancestor of the other,
and returning nullptr in all other cases. We can do better than that by
searching for the least common ancestor.

Reviewed By: @jdelong

Differential Revision: D1645986

Signature: t1:1645986:1414777888:0f6cf24c3e65240645e74a929a6e1f68d6ecea70
Convert uses of "const SrcKey&" to "SrcKey".

Summary: We've purposely made SrcKey small (64 bits), so might as well pass it
around by value if it's not being modified.

Reviewed By: @jdelong

Differential Revision: D1650522

Signature: t1:1650522:1414706464:2f4b33b69b5020cabcd049398d2aa95e13eda1ca
change ResourceData header

Summary: Move o_id after count to make room for the kind byte.
Also make m_count private like the other types.

Reviewed By: @jdelong, @elgenie

Differential Revision: D1647149
typechecker: support for abstract final

Summary: * adds parser support for 'abstract final' (but not 'final abstract')
 * introduces a visitor to typing_hint
 * uses the visitor to peer into hints to detect uninstantiable names
   for function params, method params, and typedef and class constraints

Reviewed By: @jwatzman

Differential Revision: D1645753

Signature: t1:1645753:1414707324:42f9d990059f5f50de095ed54c9513907507c51b
Revert "Silence warning from CMake Policy CMP0026"

Summary: This reverts commit https://github.com/facebook/hhvm/commit/5b8c73ab2bfb31d29d52c7bdba28bc58ba1dd066

Reviewed By: @ptarjan

Differential Revision: D1650299

Signature: t1:1650299:1414713932:a1335e585ff36e5686b9b18f6513e5f4995094ba
Fix doubled license headers

Summary: Whoops, this should have been BSD all along.

Reviewed By: @Jo-Con-El

Differential Revision: D1653495

Signature: t1:1653495:1414796786:56815b4b7af2f06e51305a317bccd186e4051ef7
typechecker: more uniformity in 'member not found' errors

Summary: Point to the declaration of the class in which the member
 wasn't found for static member access, as well as non-static member
 access. Reorder the message such that the hint (e.g. did you mean)
 comes immediately after.

Reviewed By: @jwatzman

Differential Revision: D1649908

Signature: t1:1649908:1414794120:0b9e4be0e862f4e13644c2c8e922491c24f0ba6a
typechecker: add imemoizeparam to list of autoimports from HH namespace

Reviewed By: @paroski, @jwatzman

Differential Revision: D1649940

Signature: t1:1649940:1414793639:1e5e851cc50efc8c294b2cedb793210de6082bf7
typechecker: improve instanceof handling

Summary: * disallow `instanceof parent|self|static` outside of class
 * interpret `instanceof parent|self|static` as the decoded
   class corresponding to those constructs, as opposed to
   the mythical <?php class Parent|Self|Static
 * in a condition context, passing a generic `instanceof $x` should
   imply an object ... this is strictly speaking not correct if
   `$x` can resolve to `Traversable`, `Stringish`, or some other
   interface that accepts non-object types, but those are all
   hardcoded into the typechecker and should not be observed

Reviewed By: @jwatzman

Differential Revision: D1649177

Signature: t1:1649177:1414793850:129ec1756e90bd1096320dabf3e550729e412419
Remove several raise_warning()'s from user-file.

Summary: Remove several raise_warning()'s from user-file.cpp to match PHP5 behavior.

Passing vfsstream test cases.
Closes https://github.com/facebook/hhvm/pull/4099

Reviewed By: @ptarjan

Differential Revision: D1647139

Signature: t1:1647139:1414799868:94d01e3bbb60a306eb64d275c7125dcdcbbe2f64
Rename LdGbl/StGbl to LdLocPseudoMain/StLocPseudoMain

Summary: In preparation for having a LdGbl and StGbl that operates on $GLOBALS.

Reviewed By: @alexmalyshev

Differential Revision: D1644200

Signature: t1:1644200:1414528842:67b90e3cd851addda579ef303673dbdcbc2136b0
Make prediction opts deal with arbitrary load/check instructions

Summary: Still peephole sort of thing, but now can do arrays and new load/check
instructions that I'll be adding.

Reviewed By: @ottoni

Differential Revision: D1644693
Fix some problems in Type::operator-

Summary: Type::operator- was potentially removing valid values from the result.
E.g. Int - Int<24> or Obj - Obj<Foo> would return Bottom, or
Array=(MapLikeConstant) - Array(RATPacked) would return Bottom.  This could
easily do something incorrect (if that type flowed to the wrong place, we could
e.g. fold a CheckType<Int> branch or something incorrectly based on it).  It
also was sometimes going the other way: if you subtracted a specialized array
from another specialized array, you'd get back Type::Arr, which is
unnecessarily too big (we know *this - x can't ever be any bigger than *this).

I was a little bit afraid about how we might be using this stuff---but an audit
found no uses where the right hand side wasn't a constant type that was
unspecialized (it's mostly about removing Null or Uninit from things, so I
think we're likely to be ok).  I would rather have function called
"remove_null" (or whatnot) do that sort of thing so it's clear what we're
trying to do, though---this function seems too easy to misuse...  It is
incorrect to use it with arbitrary types that you didn't control if you aren't
ok with a - b returning a after this diff (and before this diff it's incorrect
to use it in that situation because it aborted on some inputs).

Reviewed By: @markw65

Differential Revision: D1645584
Remove DUnbox dest type

Summary: No longer used.

Reviewed By: @alexmalyshev

Differential Revision: D1647527

Signature: t1:1647527:1414617442:dcf3dbf25bae4dc56ceed58602e8c54f550523af
Remove PtrToGen from FunctionSuspendHook

Summary: Only callsites seem like they should always be passing a FramePtr.
Change them.

Reviewed By: @jano

Differential Revision: D1647517

Signature: t1:1647517:1414706625:5b5abd1d3aaef35dc008cb63567073d794cccc2b
Remove incCategory from guard-relaxation.h

Summary: Not called externally.

Reviewed By: @edwinsmith

Differential Revision: D1650439

Signature: t1:1650439:1414709373:f9b681fb38a4226c7d13511d86b10a07fa10aa36
Missed one case for "LdGbl" rename (in a string)

Reviewed By: @alexmalyshev

Differential Revision: D1650578

Signature: t1:1650578:1414707402:67764bfac490a7bb1e3bbd6d98b4b7ea936ce2d1