Raise too many args if unpacking too many args
commit6f177eee054ca552dfccc1fb9eb1a0f4609025bd
authorJan Oravec <jan@fb.com>
Wed, 26 Feb 2020 11:17:09 +0000 (26 03:17 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 26 Feb 2020 11:19:57 +0000 (26 03:19 -0800)
treedf8810a4368cd90407e890760eba8c59dda22c70
parent8a0a9ba0d5b0d1bd6b4656e829a388952cc5d951
Raise too many args if unpacking too many args

Summary:
prepareFuncEntry() was not observing too many arguments condition when a callee
was called with variadic arguments. Fix this by unifying the state observed by
prepareFuncEntry(). We no longer have untrimmed and trimmed state. The new
expectations are that there are up to func->numNonVariadicParams() arguments on
the stack and all other arguments are packed into a varray that can't be empty.
This matches JIT prologue behavior (except of emptiness).

Reviewed By: ricklavoie

Differential Revision: D20088967

fbshipit-source-id: 0f1ab96796d5e90ddea6267e6d0e495cdda6cb36
hphp/runtime/base/execution-context.cpp
hphp/runtime/vm/bytecode.cpp
hphp/runtime/vm/bytecode.h
hphp/runtime/vm/jit/translator-runtime.cpp
hphp/test/slow/too-many-params-1.php
hphp/test/slow/too-many-params-1.php.expectf
hphp/test/slow/too-many-params-2.php
hphp/test/slow/too-many-params-2.php.expectf
hphp/test/slow/too-many-params-3.php
hphp/test/slow/too-many-params-3.php.expectf