| author | |
| committer | |
| log | f077c3c4ccd03f48f785ee812ab2c88c85792014 |
| tree | c7b83ad5642f4064c200a9feade04bfb3134e3ad |
| parent | 9daa7e1e193a693b4415d3db8031633236f28876 |
Fix #39512 files changed, 7 insertions(+), 0 deletions(-)
src/ir.cpp+1| ... | ... | @@ -19500,6 +19500,7 @@ static IrInstruction *ir_analyze_instruction_elem_ptr(IrAnalyze *ira, IrInstruct |
| 19500 | 19500 | } |
| 19501 | 19501 | |
| 19502 | 19502 | if (orig_array_ptr_val->special != ConstValSpecialRuntime && |
| 19503 | orig_array_ptr_val->data.x_ptr.special != ConstPtrSpecialHardCodedAddr && | |
| 19503 | 19504 | (orig_array_ptr_val->data.x_ptr.mut != ConstPtrMutRuntimeVar || |
| 19504 | 19505 | array_type->id == ZigTypeIdArray)) |
| 19505 | 19506 | { |
test/stage1/behavior/pointers.zig+6| ... | ... | @@ -282,3 +282,9 @@ test "pointer sentinel with +inf" { |
| 282 | 282 | S.doTheTest(); |
| 283 | 283 | comptime S.doTheTest(); |
| 284 | 284 | } |
| 285 | ||
| 286 | test "pointer to array at fixed address" { | |
| 287 | const array = @intToPtr(*volatile [1]u32, 0x10); | |
| 288 | // Silly check just to reference `array` | |
| 289 | expect(@ptrToInt(&array[0]) == 0x10); | |
| 290 | } |