Bug 1412097 - Baldr: update MaxFunctionBytes and check everywhere (r=lth)

MozReview-Commit-ID: DZVaYDGqt7L

--HG--
extra : rebase_source : 4d6aae6a4537b96927515d80aed39ad03842d25e
This commit is contained in:
Luke Wagner 2017-10-27 09:19:16 -05:00
parent 5ac85102ae
commit d04c7d773c
2 changed files with 4 additions and 1 deletions

View File

@ -504,7 +504,7 @@ static const unsigned MaxBrTableElems = 1000000;
static const unsigned MaxMemoryInitialPages = 16384;
static const unsigned MaxMemoryMaximumPages = 65536;
static const unsigned MaxModuleBytes = 1024 * 1024 * 1024;
static const unsigned MaxFunctionBytes = 128 * 1024;
static const unsigned MaxFunctionBytes = 7654321;
// A magic value of the FramePointer to indicate after a return to the entry
// stub that an exception has been caught and that we should throw.

View File

@ -42,6 +42,9 @@ DecodeFunctionBody(DecoderT& d, ModuleGenerator& mg, uint32_t funcIndex)
if (!d.readVarU32(&bodySize))
return d.fail("expected number of function body bytes");
if (bodySize > MaxFunctionBytes)
return d.fail("function body too big");
const size_t offsetInModule = d.currentOffset();
// Skip over the function body; it will be validated by the compilation thread.