| author | |
| committer | |
| log | 0768115b01f01ab1c75da3e42ffcdc99078eaad2 |
| tree | 94262cb3925ffadbfc80165e949c7e5e2e6cade7 |
| parent | 202e8a0589b4e02dac0694e3eb30ac0b51ec3f6c |
Also add an assert to catch this issue earlier. For future reference,
the decl without a type and value is the string literal "GET".2 files changed, 12 insertions(+), 2 deletions(-)
src/value.zig+10-2| ... | ... | @@ -2915,8 +2915,16 @@ pub const Value = extern union { |
| 2915 | 2915 | .field_ptr => val.castTag(.field_ptr).?.data.container_ptr.isVariable(mod), |
| 2916 | 2916 | .eu_payload_ptr => val.castTag(.eu_payload_ptr).?.data.container_ptr.isVariable(mod), |
| 2917 | 2917 | .opt_payload_ptr => val.castTag(.opt_payload_ptr).?.data.container_ptr.isVariable(mod), |
| 2918 | .decl_ref => mod.declPtr(val.castTag(.decl_ref).?.data).val.isVariable(mod), | |
| 2919 | .decl_ref_mut => mod.declPtr(val.castTag(.decl_ref_mut).?.data.decl_index).val.isVariable(mod), | |
| 2918 | .decl_ref => { | |
| 2919 | const decl = mod.declPtr(val.castTag(.decl_ref).?.data); | |
| 2920 | assert(decl.has_tv); | |
| 2921 | return decl.val.isVariable(mod); | |
| 2922 | }, | |
| 2923 | .decl_ref_mut => { | |
| 2924 | const decl = mod.declPtr(val.castTag(.decl_ref_mut).?.data.decl_index); | |
| 2925 | assert(decl.has_tv); | |
| 2926 | return decl.val.isVariable(mod); | |
| 2927 | }, | |
| 2920 | 2928 | |
| 2921 | 2929 | .variable => true, |
| 2922 | 2930 | else => false, |
test/behavior/bugs/3742.zig+2| ... | ... | @@ -39,5 +39,7 @@ test "fixed" { |
| 39 | 39 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 40 | 40 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; |
| 41 | 41 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 42 | if (builtin.zig_backend == .stage2_llvm and | |
| 43 | builtin.cpu.arch == .aarch64 and builtin.os.tag == .windows) return error.SkipZigTest; | |
| 42 | 44 | ArgSerializer.serializeCommand(GET.init("banana")); |
| 43 | 45 | } |