Enforce readonly return
commita1272e51835729861051a86f9a14311a62043e26
authorOguz Ulgen <oulgen@fb.com>
Tue, 24 Aug 2021 17:20:32 +0000 (24 10:20 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 24 Aug 2021 17:24:56 +0000 (24 10:24 -0700)
treec6825d40ba7e7677f9c9e49a678d9e7593b726b8
parent6a8404deacfdde55683ad736f9ba7a83a872d902
Enforce readonly return

Summary:
This diff adds enforcement for checking whether readonly returned value is read as readonly from the caller.

HHBBC optimization on the next diff.

Reviewed By: jano, kavoor

Differential Revision: D30431648

fbshipit-source-id: 76d12566f23cd12590c381b7f1c0ff0561dc46e6
16 files changed:
hphp/hhbbc/emit.cpp
hphp/hhbbc/parse.cpp
hphp/hhbbc/representation.h
hphp/runtime/base/attr.h
hphp/runtime/base/execution-context.cpp
hphp/runtime/vm/bytecode.cpp
hphp/runtime/vm/disas.cpp
hphp/runtime/vm/func-emitter.cpp
hphp/runtime/vm/jit/irgen-call.cpp
hphp/runtime/vm/runtime.cpp
hphp/runtime/vm/runtime.h
hphp/test/slow/readonly/call-enforcement/return-1.php [new file with mode: 0644]
hphp/test/slow/readonly/call-enforcement/return-1.php.expect [new file with mode: 0644]
hphp/test/slow/readonly/call-enforcement/return-2.php [new file with mode: 0644]
hphp/test/slow/readonly/call-enforcement/return-2.php.expectf [new file with mode: 0644]
hphp/test/slow/readonly/call-enforcement/return-2.php.opts [new file with mode: 0644]