Permalink
Browse files

Handle $GLOBALS in as a left hand side of '??' expressions

Summary: as in title - treat it similar to HHVM

Reviewed By: oulgen

Differential Revision: D6862409

fbshipit-source-id: 5dd9173c0afa28f4637d035487f114ddb9b7b747
  • Loading branch information...
vladima authored and hhvm-bot committed Jan 31, 2018
1 parent ea3d052 commit cea8d8f0de61d2dc68e4643c8a2ae56f9297bba9
Showing with 5 additions and 0 deletions.
  1. +5 −0 hphp/hack/src/hhbc/emit_expression.ml
@@ -1713,6 +1713,11 @@ and emit_short_circuit_op env expr =
and emit_quiet_expr env (pos, expr_ as expr) =
match expr_ with
| A.Lvar (_, name) when name = SN.Superglobals.globals ->
gather [
instr_string (SU.Locals.strip_dollar name);
instr (IGet CGetQuietG)
]
| A.Lvar ((_, name) as id) when not (is_local_this env name) ->
instr_cgetquietl (get_local env id)
| A.Dollar e ->

0 comments on commit cea8d8f

Please sign in to comment.