diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2024-08-12 00:25:47 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-12 00:25:47 +0200 |
| commit | 1761802330841533dd53bcb2e0f9f5309542e1d3 (patch) | |
| tree | 32cd4f36dbc65a516c7c1e19cba280923aa62e5c /src/llvm_backend_stmt.cpp | |
| parent | b9e68ee3c157d05bdb4d8b34357dd577a0a793fc (diff) | |
| parent | 99aa0d3a35a86d00c488554ff712c922f7133005 (diff) | |
Merge pull request #4062 from laytan/fix-switch-over-internal-pointer-union
fix type switching over internal pointer union
Diffstat (limited to 'src/llvm_backend_stmt.cpp')
| -rw-r--r-- | src/llvm_backend_stmt.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/llvm_backend_stmt.cpp b/src/llvm_backend_stmt.cpp index e70cc503e..8f1c3a123 100644 --- a/src/llvm_backend_stmt.cpp +++ b/src/llvm_backend_stmt.cpp @@ -1646,7 +1646,7 @@ gb_internal void lb_build_type_switch_stmt(lbProcedure *p, AstTypeSwitchStmt *ss union_data = lb_emit_conv(p, parent_ptr, t_rawptr); Type *union_type = type_deref(parent_ptr.type); if (is_type_union_maybe_pointer(union_type)) { - tag = lb_emit_conv(p, lb_emit_comp_against_nil(p, Token_NotEq, union_data), t_int); + tag = lb_emit_conv(p, lb_emit_comp_against_nil(p, Token_NotEq, parent_value), t_int); } else if (union_tag_size(union_type) == 0) { tag = {}; // there is no tag for a zero sized union } else { |