diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-12-18 00:53:29 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-12-18 00:53:29 -0500 |
| commit | 69cf0ea56877a6f9bae51a35cffde371bf142567 (patch) | |
| tree | 60f34e861c3aa4615691eeb87c8d6f9a70dcea48 /src/ir.cpp | |
| parent | 3e4194bf9e0ccca122049be730ede0a2ca208c85 (diff) | |
| download | zig-69cf0ea56877a6f9bae51a35cffde371bf142567.tar.gz zig-69cf0ea56877a6f9bae51a35cffde371bf142567.zip | |
IR: fix type of decls accessed via namespace
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 64ffa022ac..b2f7f960a8 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -5057,7 +5057,7 @@ static TypeTableEntry *ir_analyze_ref(IrAnalyze *ira, IrInstruction *source_inst return ira->codegen->builtin_types.entry_invalid; bool is_inline = ir_should_inline(&ira->new_irb); - if (is_inline || value->static_value.special != ConstValSpecialRuntime) { + if (is_inline || instr_is_comptime(value)) { ConstExprValue *val = ir_resolve_const(ira, value, UndefBad); if (!val) return ira->codegen->builtin_types.entry_invalid; @@ -6770,7 +6770,7 @@ static TypeTableEntry *ir_analyze_decl_ref(IrAnalyze *ira, IrInstruction *source const_val->data.x_type = tld_container->type_entry; bool ptr_is_const = true; - return ir_analyze_const_ptr(ira, source_instruction, const_val, tld_container->type_entry, + return ir_analyze_const_ptr(ira, source_instruction, const_val, ira->codegen->builtin_types.entry_type, depends_on_compile_var, ConstPtrSpecialNone, ptr_is_const); } case TldIdTypeDef: @@ -6785,7 +6785,7 @@ static TypeTableEntry *ir_analyze_decl_ref(IrAnalyze *ira, IrInstruction *source const_val->data.x_type = tld_typedef->type_entry; bool ptr_is_const = true; - return ir_analyze_const_ptr(ira, source_instruction, const_val, tld_typedef->type_entry, + return ir_analyze_const_ptr(ira, source_instruction, const_val, ira->codegen->builtin_types.entry_type, depends_on_compile_var, ConstPtrSpecialNone, ptr_is_const); } } |
