From 4d630bed58094915abe36f599fe2cb5484d32a6f Mon Sep 17 00:00:00 2001 From: LoganDark Date: Mon, 8 Nov 2021 13:18:59 -0800 Subject: [PATCH] remove kSpecialGlobals entirely --- Compiler/src/Compiler.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Compiler/src/Compiler.cpp b/Compiler/src/Compiler.cpp index 8afd14f9..fa7a675a 100644 --- a/Compiler/src/Compiler.cpp +++ b/Compiler/src/Compiler.cpp @@ -22,8 +22,6 @@ static const uint32_t kMaxRegisterCount = 255; static const uint32_t kMaxUpvalueCount = 200; static const uint32_t kMaxLocalCount = 200; -static const char* kSpecialGlobals[] = {"_G"}; - CompileError::CompileError(const Location& location, const std::string& message) : location(location) , message(message) @@ -3704,9 +3702,8 @@ void compileOrThrow(BytecodeBuilder& bytecode, AstStatBlock* root, const AstName Compiler compiler(bytecode, options); // since access to some global objects may result in values that change over time, we block imports from non-readonly tables - for (const char* global : kSpecialGlobals) { - AstName name = names.get(global); + AstName name = names.get("_G"); if (name.value) compiler.globals[name].writable = true;