| author | |
| committer | |
| log | d72f832b1ebab0db106e64bc9f59eba90c414311 |
| tree | 89716f3ddbd8f2ed0e2ce65938b0ac93a50f9b23 |
| parent | 335c680cde670776280c3a812adb64abd1311d97 |
when appropriate. Avoids tripping an LLVM assertion.1 files changed, 5 insertions(+), 1 deletions(-)
src/codegen/llvm.zig+5-1| ... | ... | @@ -1858,7 +1858,11 @@ pub const DeclGen = struct { |
| 1858 | 1858 | try self.resolveGlobalDecl(decl); |
| 1859 | 1859 | |
| 1860 | 1860 | const llvm_type = try self.llvmType(tv.ty); |
| 1861 | return llvm_val.constBitCast(llvm_type); | |
| 1861 | if (tv.ty.zigTypeTag() == .Int) { | |
| 1862 | return llvm_val.constPtrToInt(llvm_type); | |
| 1863 | } else { | |
| 1864 | return llvm_val.constBitCast(llvm_type); | |
| 1865 | } | |
| 1862 | 1866 | } |
| 1863 | 1867 | |
| 1864 | 1868 | fn lowerPtrToVoid(dg: *DeclGen, ptr_ty: Type) !*const llvm.Value { |