diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-01-27 12:43:03 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-01-27 12:43:03 -0700 |
| commit | 261517aa4443404e0ab7b7925937a5c1046f58f5 (patch) | |
| tree | f8668a9360dc75cefbe3492f8e0b8244d95be7dc /src/codegen.cpp | |
| parent | e809baa8662ed2a8ad0d2b304bc89c4a6982f3dd (diff) | |
| download | zig-261517aa4443404e0ab7b7925937a5c1046f58f5.tar.gz zig-261517aa4443404e0ab7b7925937a5c1046f58f5.zip | |
add explicit cast from isize/usize to pointer
closes #91
Diffstat (limited to 'src/codegen.cpp')
| -rw-r--r-- | src/codegen.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index e99baf66ff..89abae8cec 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -428,6 +428,9 @@ static LLVMValueRef gen_cast_expr(CodeGen *g, AstNode *node) { case CastOpPtrToInt: add_debug_source_node(g, node); return LLVMBuildPtrToInt(g->builder, expr_val, wanted_type->type_ref, ""); + case CastOpIntToPtr: + add_debug_source_node(g, node); + return LLVMBuildIntToPtr(g->builder, expr_val, wanted_type->type_ref, ""); case CastOpPointerReinterpret: add_debug_source_node(g, node); return LLVMBuildBitCast(g->builder, expr_val, wanted_type->type_ref, ""); |
