diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-01-11 22:26:55 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-01-11 22:26:55 -0500 |
| commit | eb3726c502e92ec4a3689732a76479c6d561cff5 (patch) | |
| tree | 91f14deeaffd5e475c11be3ec8572b66a3799b37 /src/ir.cpp | |
| parent | d1d3dbc7b5bc986849db476e491300ffd18d4db5 (diff) | |
| parent | 3268276b58d8b65cb295b738d7c14174005bd84e (diff) | |
| download | zig-eb3726c502e92ec4a3689732a76479c6d561cff5.tar.gz zig-eb3726c502e92ec4a3689732a76479c6d561cff5.zip | |
Merge branch 'master' into llvm6
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 176e5791f8..f236910250 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -13224,9 +13224,9 @@ static TypeTableEntry *ir_analyze_instruction_embed_file(IrAnalyze *ira, IrInstr os_path_resolve(&source_dir_path, rel_file_path, &file_path); // load from file system into const expr - Buf file_contents = BUF_INIT; + Buf *file_contents = buf_alloc(); int err; - if ((err = os_fetch_file_path(&file_path, &file_contents))) { + if ((err = os_fetch_file_path(&file_path, file_contents))) { if (err == ErrorFileNotFound) { ir_add_error(ira, instruction->name, buf_sprintf("unable to find '%s'", buf_ptr(&file_path))); return ira->codegen->builtin_types.entry_invalid; @@ -13240,9 +13240,9 @@ static TypeTableEntry *ir_analyze_instruction_embed_file(IrAnalyze *ira, IrInstr // we'll have to invalidate the cache ConstExprValue *out_val = ir_build_const_from(ira, &instruction->base); - init_const_str_lit(ira->codegen, out_val, &file_contents); + init_const_str_lit(ira->codegen, out_val, file_contents); - return get_array_type(ira->codegen, ira->codegen->builtin_types.entry_u8, buf_len(&file_contents)); + return get_array_type(ira->codegen, ira->codegen->builtin_types.entry_u8, buf_len(file_contents)); } static TypeTableEntry *ir_analyze_instruction_cmpxchg(IrAnalyze *ira, IrInstructionCmpxchg *instruction) { |
