authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-06-26 18:49:38-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-06-27 00:46:31-07:00
logd881d841ed85808e59c20db6a25b019ab2e019f8
tree52fc6bd12d86df7a1fa3c2f787f7c112e7752ea9
parentd9e867172e85270d479fc1b00f42648bc0ca0179

Sema: use tmp_hack_arena as a temporary solution for lifetime issues

All of this code is expected to get rewritten anyway. Closes #16216

1 files changed, 5 insertions(+), 5 deletions(-)

src/Sema.zig+5-5
......@@ -28885,7 +28885,7 @@ fn beginComptimePtrMutation(
2888528885 // If we wanted to avoid this, there would need to be special detection
2888628886 // elsewhere to identify when writing a value to an array element that is stored
2888728887 // using the `bytes` tag, and handle it without making a call to this function.
28888 const arena = sema.arena;
28888 const arena = mod.tmp_hack_arena.allocator();
2888928889
2889028890 const bytes = val_ptr.castTag(.bytes).?.data;
2889128891 const dest_len = parent.ty.arrayLenIncludingSentinel(mod);
......@@ -28917,7 +28917,7 @@ fn beginComptimePtrMutation(
2891728917 // need to be special detection elsewhere to identify when writing a value to an
2891828918 // array element that is stored using the `repeated` tag, and handle it
2891928919 // without making a call to this function.
28920 const arena = sema.arena;
28920 const arena = mod.tmp_hack_arena.allocator();
2892128921
2892228922 const repeated_val = try val_ptr.castTag(.repeated).?.data.intern(parent.ty.childType(mod), mod);
2892328923 const array_len_including_sentinel =
......@@ -28955,7 +28955,7 @@ fn beginComptimePtrMutation(
2895528955 // An array has been initialized to undefined at comptime and now we
2895628956 // are for the first time setting an element. We must change the representation
2895728957 // of the array from `undef` to `array`.
28958 const arena = sema.arena;
28958 const arena = mod.tmp_hack_arena.allocator();
2895928959
2896028960 const array_len_including_sentinel =
2896128961 try sema.usizeCast(block, src, parent.ty.arrayLenIncludingSentinel(mod));
......@@ -29053,7 +29053,7 @@ fn beginComptimePtrMutation(
2905329053 parent.mut_decl,
2905429054 ),
2905529055 .repeated => {
29056 const arena = sema.arena;
29056 const arena = mod.tmp_hack_arena.allocator();
2905729057
2905829058 const elems = try arena.alloc(Value, parent.ty.structFieldCount(mod));
2905929059 @memset(elems, val_ptr.castTag(.repeated).?.data);
......@@ -29116,7 +29116,7 @@ fn beginComptimePtrMutation(
2911629116 // A struct or union has been initialized to undefined at comptime and now we
2911729117 // are for the first time setting a field. We must change the representation
2911829118 // of the struct/union from `undef` to `struct`/`union`.
29119 const arena = sema.arena;
29119 const arena = mod.tmp_hack_arena.allocator();
2912029120
2912129121 switch (parent.ty.zigTypeTag(mod)) {
2912229122 .Struct => {