Fix stack spilling issues
commitbf0b817ee221464b74363954a09141747e51923f
authormwilliams <mwilliams@fb.com>
Fri, 4 Apr 2014 16:21:38 +0000 (4 09:21 -0700)
committerSara Golemon <sgolemon@fb.com>
Sun, 6 Apr 2014 00:56:57 +0000 (5 17:56 -0700)
treea9e266d0bae9b26de07137b5c6968a707d39aeed
parent5dab3c5e0a38907756dd436957c3f6b3cbc3828d
Fix stack spilling issues

peekSpillValues returned an array that was in the reverse
order of the array in m_evalStack. This is surprising, and in a few
places people had then manipulated it incorrectly (pushing a value on
the end, thinking that was the new "top"), resulting in incorrect
results when the stack was not empty.

This reverses the order of the elements in peekSpillValues, and fixes
the places that needed fixing (most did not, because they were backwards
to start with).

Reviewed By: @alexmalyshev

Differential Revision: D1259234
hphp/runtime/vm/jit/hhbc-translator.cpp
hphp/runtime/vm/jit/minstr-translator.cpp
hphp/test/slow/arithmetic/edge_cases.php [new file with mode: 0644]
hphp/test/slow/arithmetic/edge_cases.php.expectf [new file with mode: 0644]
hphp/test/slow/arithmetic/edge_cases.php.hphp_opts [new file with mode: 0644]
hphp/test/slow/arithmetic/edge_cases.php.opts [new file with mode: 0644]