| author | |
| committer | |
| log | fa34dfcce7bfe44840c0cf1ac450c2dc457ce94a |
| tree | eba12d7b22b934caa82966c669e846268addab39 |
| parent | e0db54e89d6f4e9f56800ddb1017e30be1b7d58a |
| signature |
3 files changed, 8 insertions(+), 8 deletions(-)
src/ir.cpp+1-1| ... | ... | @@ -15733,7 +15733,7 @@ static IrInstruction *ir_resolve_result_raw(IrAnalyze *ira, IrInstruction *suspe |
| 15733 | 15733 | casted_value = nullptr; |
| 15734 | 15734 | } |
| 15735 | 15735 | |
| 15736 | if (casted_value == nullptr || type_is_invalid(casted_value->value.type)) { | |
| 15736 | if (casted_value != nullptr && type_is_invalid(casted_value->value.type)) { | |
| 15737 | 15737 | return casted_value; |
| 15738 | 15738 | } |
| 15739 | 15739 |
test/stage1/behavior.zig+2-2| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | comptime { |
| 2 | //_ = @import("behavior/align.zig"); | |
| 2 | _ = @import("behavior/align.zig"); | |
| 3 | 3 | _ = @import("behavior/alignof.zig"); |
| 4 | 4 | //_ = @import("behavior/array.zig"); |
| 5 | 5 | _ = @import("behavior/asm.zig"); |
| ... | ... | @@ -73,7 +73,7 @@ comptime { |
| 73 | 73 | _ = @import("behavior/ir_block_deps.zig"); |
| 74 | 74 | _ = @import("behavior/math.zig"); |
| 75 | 75 | _ = @import("behavior/merge_error_sets.zig"); |
| 76 | //_ = @import("behavior/misc.zig"); | |
| 76 | _ = @import("behavior/misc.zig"); | |
| 77 | 77 | _ = @import("behavior/muladd.zig"); |
| 78 | 78 | _ = @import("behavior/namespace_depends_on_compile_var.zig"); |
| 79 | 79 | _ = @import("behavior/new_stack_call.zig"); |
test/stage1/behavior/misc.zig+5-5| ... | ... | @@ -241,14 +241,14 @@ fn memFree(comptime T: type, memory: []T) void {} |
| 241 | 241 | |
| 242 | 242 | test "cast undefined" { |
| 243 | 243 | const array: [100]u8 = undefined; |
| 244 | const slice = ([]const u8)(array); | |
| 244 | const slice = @as([]const u8, array); | |
| 245 | 245 | testCastUndefined(slice); |
| 246 | 246 | } |
| 247 | 247 | fn testCastUndefined(x: []const u8) void {} |
| 248 | 248 | |
| 249 | 249 | test "cast small unsigned to larger signed" { |
| 250 | expect(castSmallUnsignedToLargerSigned1(200) == i16(200)); | |
| 251 | expect(castSmallUnsignedToLargerSigned2(9999) == i64(9999)); | |
| 250 | expect(castSmallUnsignedToLargerSigned1(200) == @as(i16, 200)); | |
| 251 | expect(castSmallUnsignedToLargerSigned2(9999) == @as(i64, 9999)); | |
| 252 | 252 | } |
| 253 | 253 | fn castSmallUnsignedToLargerSigned1(x: u8) i16 { |
| 254 | 254 | return x; |
| ... | ... | @@ -350,7 +350,7 @@ fn testTakeAddressOfParameter(f: f32) void { |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | test "pointer comparison" { |
| 353 | const a = ([]const u8)("a"); | |
| 353 | const a = @as([]const u8, "a"); | |
| 354 | 354 | const b = &a; |
| 355 | 355 | expect(ptrEql(b, b)); |
| 356 | 356 | } |
| ... | ... | @@ -642,7 +642,7 @@ test "self reference through fn ptr field" { |
| 642 | 642 | |
| 643 | 643 | test "volatile load and store" { |
| 644 | 644 | var number: i32 = 1234; |
| 645 | const ptr = (*volatile i32)(&number); | |
| 645 | const ptr = @as(*volatile i32, &number); | |
| 646 | 646 | ptr.* += 1; |
| 647 | 647 | expect(ptr.* == 1235); |
| 648 | 648 | } |