From: Dale Weiler Date: Fri, 30 Jan 2015 05:46:25 +0000 (-0500) Subject: Same on the cleanup branch X-Git-Tag: xonotic-v0.8.2~9^2 X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=commitdiff_plain;h=fa21d85820ecf7ac59606ce36771b7e3314827d5;ds=sidebyside Same on the cleanup branch --- diff --git a/ir.cpp b/ir.cpp index ba4ed64..7f45899 100644 --- a/ir.cpp +++ b/ir.cpp @@ -3433,6 +3433,8 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global, bool isloc { ir_value_code_setaddr(global, self->m_code->globals.size()); if (global->m_hasvalue) { + if (global->m_cvq == CV_CONST && global->m_reads.empty()) + return true; iptr = (int32_t*)&global->m_constval.ivec[0]; self->m_code->globals.push_back(*iptr); } else { @@ -3448,6 +3450,8 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global, bool isloc { ir_value_code_setaddr(global, self->m_code->globals.size()); if (global->m_hasvalue) { + if (global->m_cvq == CV_CONST && global->m_reads.empty()) + return true; uint32_t load = code_genstring(self->m_code.get(), global->m_constval.vstring); self->m_code->globals.push_back(load); } else {