Fix refable issue with foldable functions
commit24ba66671b9f24957aba3e521fe5367769330e37
authorMark Williams <mwilliams@fb.com>
Mon, 24 Oct 2016 14:14:07 +0000 (24 07:14 -0700)
committerHhvm Bot <hhvm-bot-bot@fb.com>
Mon, 24 Oct 2016 14:22:59 +0000 (24 07:22 -0700)
tree326e500c204499413a81625eb6f11973d51c4218
parent2ae019064ff27b68ed9366f9211b232353f54db4
Fix refable issue with foldable functions

Summary:
The result of a function call is always "refable" - ie it can be
passed to a function expecting a value by reference, even if the
function returns by value. When we constant fold a function call, we
might have to wrap the result to avoid warnings and errors.

Reviewed By: mxw

Differential Revision: D4051062

fbshipit-source-id: 63ccfcf9f689bf42f6a685e0e048189bf8a059d2
hphp/compiler/analysis/emitter.cpp
hphp/compiler/expression/expression.cpp
hphp/compiler/expression/expression.h
hphp/compiler/expression/expression_list.cpp
hphp/compiler/expression/expression_list.h
hphp/compiler/expression/simple_function_call.cpp
hphp/test/slow/function/fold-by-ref.php [new file with mode: 0644]
hphp/test/slow/function/fold-by-ref.php.expect [new file with mode: 0644]