mirror of
https://github.com/ziglang/zig.git
synced 2026-01-10 09:25:11 +00:00
fix assertion with var debug loc not initialized
This commit is contained in:
parent
9d59cdb8c1
commit
c58633ef17
@ -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 {
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user