| ... | ... | @@ -1174,6 +1174,10 @@ pub const Value = extern union { |
| 1174 | 1174 | return; |
| 1175 | 1175 | } |
| 1176 | 1176 | switch (ty.zigTypeTag()) { |
| 1177 | .Void => {}, |
| 1178 | .Bool => { |
| 1179 | buffer[0] = @boolToInt(val.toBool()); |
| 1180 | }, |
| 1177 | 1181 | .Int => { |
| 1178 | 1182 | var bigint_buffer: BigIntSpace = undefined; |
| 1179 | 1183 | const bigint = val.toBigInt(&bigint_buffer, target); |
| ... | ... | @@ -1291,6 +1295,14 @@ pub const Value = extern union { |
| 1291 | 1295 | ) Allocator.Error!Value { |
| 1292 | 1296 | const target = mod.getTarget(); |
| 1293 | 1297 | switch (ty.zigTypeTag()) { |
| 1298 | .Void => return Value.@"void", |
| 1299 | .Bool => { |
| 1300 | if (buffer[0] == 0) { |
| 1301 | return Value.@"false"; |
| 1302 | } else { |
| 1303 | return Value.@"true"; |
| 1304 | } |
| 1305 | }, |
| 1294 | 1306 | .Int => { |
| 1295 | 1307 | if (buffer.len == 0) return Value.zero; |
| 1296 | 1308 | const int_info = ty.intInfo(target); |
| ... | ... | @@ -1311,7 +1323,7 @@ pub const Value = extern union { |
| 1311 | 1323 | 128 => return Value.Tag.float_128.create(arena, floatReadFromMemory(f128, target, buffer)), |
| 1312 | 1324 | else => unreachable, |
| 1313 | 1325 | }, |
| 1314 | | .Array => { |
| 1326 | .Array, .Vector => { |
| 1315 | 1327 | const elem_ty = ty.childType(); |
| 1316 | 1328 | const elem_size = elem_ty.abiSize(target); |
| 1317 | 1329 | const elems = try arena.alloc(Value, @intCast(usize, ty.arrayLen())); |