| ... | @@ -1661,7 +1661,7 @@ pub const Object = struct { | ... | @@ -1661,7 +1661,7 @@ pub const Object = struct { |
| 1661 | const alias = try o.builder.addAlias( | 1661 | const alias = try o.builder.addAlias( |
| 1662 | exp_name, | 1662 | exp_name, |
| 1663 | llvm_global_ty, | 1663 | llvm_global_ty, |
| 1664 | .default, | 1664 | global_index.ptrConst(&o.builder).addr_space, |
| 1665 | global_index.toConst(), | 1665 | global_index.toConst(), |
| 1666 | ); | 1666 | ); |
| 1667 | break :global alias.ptrConst(&o.builder).global; | 1667 | break :global alias.ptrConst(&o.builder).global; |
| ... | @@ -1673,6 +1673,10 @@ pub const Object = struct { | ... | @@ -1673,6 +1673,10 @@ pub const Object = struct { |
| 1673 | // We can just repurpose the existing alias. | 1673 | // We can just repurpose the existing alias. |
| 1674 | alias.setAliasee(global_index.toConst(), &o.builder); | 1674 | alias.setAliasee(global_index.toConst(), &o.builder); |
| 1675 | alias.ptrConst(&o.builder).global.ptr(&o.builder).type = global_index.typeOf(&o.builder); | 1675 | alias.ptrConst(&o.builder).global.ptr(&o.builder).type = global_index.typeOf(&o.builder); |
| | 1676 | // If the type the alias is pointing to can change, then |
| | 1677 | // it makes sense that we should update the address |
| | 1678 | // space too. |
| | 1679 | alias.ptrConst(&o.builder).global.ptr(&o.builder).addr_space = global_index.ptrConst(&o.builder).addr_space; |
| 1676 | break :global existing_global; | 1680 | break :global existing_global; |
| 1677 | }, | 1681 | }, |
| 1678 | .variable, .function => { | 1682 | .variable, .function => { |
| ... | @@ -1687,7 +1691,7 @@ pub const Object = struct { | ... | @@ -1687,7 +1691,7 @@ pub const Object = struct { |
| 1687 | const alias = try o.builder.addAlias( | 1691 | const alias = try o.builder.addAlias( |
| 1688 | exp_name, | 1692 | exp_name, |
| 1689 | llvm_global_ty, | 1693 | llvm_global_ty, |
| 1690 | .default, | 1694 | global_index.ptrConst(&o.builder).addr_space, |
| 1691 | global_index.toConst(), | 1695 | global_index.toConst(), |
| 1692 | ); | 1696 | ); |
| 1693 | break :global alias.ptrConst(&o.builder).global; | 1697 | break :global alias.ptrConst(&o.builder).global; |