diff options
| author | Tadeo Kondrak <me@tadeo.ca> | 2020-04-28 00:24:28 -0600 |
|---|---|---|
| committer | Tadeo Kondrak <me@tadeo.ca> | 2020-04-28 00:24:45 -0600 |
| commit | 249938dde060acf129d829bbe4e3bc097428c5a7 (patch) | |
| tree | a585240304c5335f0ee091f0156f1e368d706ee2 /src/ir.cpp | |
| parent | 01605a77428aefedbdf76830b6e4cab4853f2e4e (diff) | |
| download | zig-249938dde060acf129d829bbe4e3bc097428c5a7.tar.gz zig-249938dde060acf129d829bbe4e3bc097428c5a7.zip | |
Validate vector types for @Vector
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 8cfc492a7d..4795645544 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -25426,6 +25426,10 @@ static ZigType *type_info_to_type(IrAnalyze *ira, IrInst *source_instr, ZigTypeI assert(payload->type == ir_type_info_get_type(ira, "Vector", nullptr)); BigInt *len = get_const_field_lit_int(ira, source_instr->source_node, payload, "len", 0); ZigType *child_type = get_const_field_meta_type(ira, source_instr->source_node, payload, "child", 1); + Error err; + if ((err = ir_validate_vector_elem_type(ira, source_instr->source_node, child_type))) { + return ira->codegen->invalid_inst_gen->value->type; + } return get_vector_type(ira->codegen, bigint_as_u32(len), child_type); } case ZigTypeIdAnyFrame: { |
