Fix use-after-free bug in RPC handler
[hiphop-php.git] / hphp / compiler / builtin_symbols.h
blob16f4d75de024859c324b3ac030dcffc6fdc581af
1 /*
2 +----------------------------------------------------------------------+
3 | HipHop for PHP |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
17 #ifndef incl_HPHP_BUILTIN_SYMBOLS_H_
18 #define incl_HPHP_BUILTIN_SYMBOLS_H_
20 #include <set>
21 #include <string>
23 #include "hphp/compiler/hphp.h"
25 namespace HPHP {
26 ///////////////////////////////////////////////////////////////////////////////
28 DECLARE_EXTENDED_BOOST_TYPES(Type);
29 DECLARE_BOOST_TYPES(AnalysisResult);
30 DECLARE_EXTENDED_BOOST_TYPES(FunctionScope);
31 DECLARE_EXTENDED_BOOST_TYPES(ClassScope);
32 DECLARE_BOOST_TYPES(VariableTable);
33 DECLARE_BOOST_TYPES(ConstantTable);
35 struct BuiltinSymbols {
36 static bool Loaded;
37 static AnalysisResultPtr s_systemAr;
39 static bool Load(AnalysisResultPtr ar);
41 /**
42 * Testing whether a variable is a PHP superglobal.
44 static bool IsSuperGlobal(const std::string &name);
46 static void LoadSuperGlobals();
48 static const char *const GlobalNames[];
49 static int NumGlobalNames();
50 private:
51 static hphp_string_set s_superGlobals;
53 static std::set<std::string> s_declaredDynamic;
55 static void ImportNativeConstants(AnalysisResultPtr ar,
56 ConstantTablePtr dest);
59 ///////////////////////////////////////////////////////////////////////////////
61 #endif // incl_HPHP_BUILTIN_SYMBOLS_H_