aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/codegen.cpp6
-rw-r--r--src/ir.cpp8
2 files changed, 6 insertions, 8 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 52e20108de..071dd1fde4 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -4661,7 +4661,8 @@ static LLVMValueRef ir_render_return_address(CodeGen *g, IrExecutable *executabl
IrInstructionReturnAddress *instruction)
{
LLVMValueRef zero = LLVMConstNull(g->builtin_types.entry_i32->type_ref);
- return LLVMBuildCall(g->builder, get_return_address_fn_val(g), &zero, 1, "");
+ LLVMValueRef ptr_val = LLVMBuildCall(g->builder, get_return_address_fn_val(g), &zero, 1, "");
+ return LLVMBuildPtrToInt(g->builder, ptr_val, g->builtin_types.entry_usize->type_ref, "");
}
static LLVMValueRef get_frame_address_fn_val(CodeGen *g) {
@@ -4682,7 +4683,8 @@ static LLVMValueRef ir_render_frame_address(CodeGen *g, IrExecutable *executable
IrInstructionFrameAddress *instruction)
{
LLVMValueRef zero = LLVMConstNull(g->builtin_types.entry_i32->type_ref);
- return LLVMBuildCall(g->builder, get_frame_address_fn_val(g), &zero, 1, "");
+ LLVMValueRef ptr_val = LLVMBuildCall(g->builder, get_frame_address_fn_val(g), &zero, 1, "");
+ return LLVMBuildPtrToInt(g->builder, ptr_val, g->builtin_types.entry_usize->type_ref, "");
}
static LLVMValueRef get_handle_fn_val(CodeGen *g) {
diff --git a/src/ir.cpp b/src/ir.cpp
index e081b4b052..4e07221ecd 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -20142,18 +20142,14 @@ static IrInstruction *ir_analyze_instruction_breakpoint(IrAnalyze *ira, IrInstru
static IrInstruction *ir_analyze_instruction_return_address(IrAnalyze *ira, IrInstructionReturnAddress *instruction) {
IrInstruction *result = ir_build_return_address(&ira->new_irb,
instruction->base.scope, instruction->base.source_node);
- ZigType *u8 = ira->codegen->builtin_types.entry_u8;
- ZigType *u8_ptr_const = get_pointer_to_type(ira->codegen, u8, true);
- result->value.type = u8_ptr_const;
+ result->value.type = ira->codegen->builtin_types.entry_usize;
return result;
}
static IrInstruction *ir_analyze_instruction_frame_address(IrAnalyze *ira, IrInstructionFrameAddress *instruction) {
IrInstruction *result = ir_build_frame_address(&ira->new_irb,
instruction->base.scope, instruction->base.source_node);
- ZigType *u8 = ira->codegen->builtin_types.entry_u8;
- ZigType *u8_ptr_const = get_pointer_to_type(ira->codegen, u8, true);
- result->value.type = u8_ptr_const;
+ result->value.type = ira->codegen->builtin_types.entry_usize;
return result;
}