Commit c58633ef17
Changed files (2)
src/all_types.hpp
@@ -2286,6 +2286,7 @@ struct ZigVar {
bool is_thread_local;
bool is_comptime_memoized;
bool is_comptime_memoized_value;
+ bool did_the_decl_codegen;
};
struct ErrorTableEntry {
src/codegen.cpp
@@ -3505,6 +3505,7 @@ static void render_decl_var(CodeGen *g, ZigVar *var) {
static LLVMValueRef ir_render_decl_var(CodeGen *g, IrExecutableGen *executable, IrInstGenDeclVar *instruction) {
instruction->var->ptr_instruction = instruction->var_ptr;
+ instruction->var->did_the_decl_codegen = true;
render_decl_var(g, instruction->var);
return nullptr;
}
@@ -3973,7 +3974,7 @@ static void render_async_var_decls(CodeGen *g, Scope *scope) {
return;
case ScopeIdVarDecl: {
ZigVar *var = reinterpret_cast<ScopeVarDecl *>(scope)->var;
- if (var->ptr_instruction != nullptr) {
+ if (var->did_the_decl_codegen) {
render_decl_var(g, var);
}
// fallthrough