Add HeaderKind::Resumable and ResumableObj

Summary: Resumable objects (c_Generator, c_AsyncGenerator, and
c_AsyncFunctionWaitHandle) are allocated after a partial
frame and Resumable object. Use size-tracked allocation
to allocate them so they are visible to objprof, and add
a HeaderKind for the embedded object so heap tracing (later)
can find the true header.

Reviewed By: @markw65

Differential Revision: D1739925
Use MM for MySQL resource

Reviewed By: @edwinsmith

Differential Revision: D1729488
make recursion limit for unserialize

Summary: This fixes a stack overflow caused by unlimited recursion in
unserialize. By checking the stack size, we avoid the stack overflow without
breaking anything else. There is no obvious way of running arbitrary code via
this, especially since all inputs to unserialize should be sanitized, but this
will close out this cve and prevent possible exploits.

CVE-2009-4418

Reviewed By: @bertmaher

Differential Revision: D1686292
Update softmagic/libmagic

Summary: Fixes for upstream vulnerabilities/heap buffer overflows in file library

CVE-2014-3480
CVE-2014-3479
CVE-2014-3478

Reviewed By: @JoelMarcey

Differential Revision: D1715704
Zero-extend bools when passed to a wider type through Jmp

Reviewed By: @edwinsmith

Differential Revision: D1750827
Update libmagic

Summary: Update libmagic to pull in fixes for various CVEs

CVE-2014-0207
CVE-2014-0237

Reviewed By: @JoelMarcey, @paulbiss

Differential Revision: D1713417
Limit glob flags to only ones supported by php

Summary: PHP only lists support for a few glob flags. There was a segfault in
glob caused by passing invalid flags. To prevent that only allow php glob flags
to be used when calling glob.

CVE-2011-1657

Reviewed By: @paulbiss

Differential Revision: D1696172
Add CPU option for JIT (EvalJitCPU). Defaults to 'native'.

Summary: Currently the option is only used by LLVM backend, but can potentially
be used by vasm or others.

The main purpose is testing and tuning.

Reviewed By: @jasone

Differential Revision: D1749428
Skip memory_get_usage test if smartalloc is off

Summary: memory_get_usage(true) gives you different results depending on
whether the smart allocator is in use or not, so this test fails if you're
running an ASAN build.  This test doesn't feel that valuable in that scenario,
so just disable it.

Reviewed By: @edwinsmith

Differential Revision: D1749906

Signature: t1:1749906:1419004931:4ed4f1d1bef2f402620bb58bafc9e3b735307022
fix for iconv_mime_decode_headers function skipping headers

Summary: A malformed mime header causes hhvm to punt on the rest of the
decode. This diff is a port of the fix for https://bugs.php.net/bug.php?id=52941
since the code is almost identical and solves the problem with embedded '=' and
'?' in mime headers.

CVE-2010-4699

Reviewed By: @JoelMarcey

Differential Revision: D1689385
Don't skip the first file in diff

Summary: hh_format --diff ignores first file in the list.

Reviewed By: @jwatzman

Differential Revision: D1741059
Don't destroy whitespace in files with "**/" in comments

Summary: ** is lexed as exponentiation operator, which then results in unterminated comment, and everything breaks.

Reviewed By: @elgenie

Differential Revision: D1741716
Fix header injection

Summary: This is a minimal fix (suitable for hotfixing) for
the attached task.

Reviewed By: @jasone

Differential Revision: D1730314
Properly functorize logging code too

Summary: Cleaning up some code

Reviewed By: @int3

Differential Revision: D1751962

Signature: t1:1751962:1419026223:2bec3f80fafa7a227f03510a4d49eb2e3b3e6f03
Fix bug with hh_format --diff duplicating some lines.

Summary: Off by one (consumed newline) error.

Reviewed By: @elgenie

Differential Revision: D1744556
Don't add trailing commas in template parameter lists

Summary: Typehint lists with trailing commas are not universally accepted, e.g
  (function(int,):void)
is OK, but
  MyClass<int,>
is not.

Reviewed By: @elgenie, @dlreeves

Differential Revision: D1744710
Don't add trailing commas in used trait lists

Summary: Another place where trailing commas don't work (in runtime, Hack is happy with this):

"Hit fatal : While autoloading class [...] from [...]: syntax error, unexpected ';'"

Reviewed By: @int3

Differential Revision: D1746379