Skip to content

Commit

Permalink
Convert ref to ptr first
Browse files Browse the repository at this point in the history
  • Loading branch information
Victorious3 committed Apr 27, 2024
1 parent 6512082 commit b185e56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/compiler.pr
Original file line number Diff line number Diff line change
Expand Up @@ -4294,8 +4294,8 @@ def walk_AlignOf(node: &parser::Node, state: &State) -> Value {
}

def convert_ref_to_int(node: &parser::Node, value: Value, loc: &Value, state: &State) -> Value {
let gep_ret = state.extract_value(pointer(value.tpe.tpe), value, [1], loc)
return state.ptr_to_int(gep_ret, loc)
let ptr = convert_ref_to_ptr(pointer(value.tpe.tpe if value.tpe.tpe else builtins::int8_), value, loc, state)
return state.ptr_to_int(ptr, loc)
}

def compare(node: &parser::Node, left: Value, right: Value, state: &State) -> Value {
Expand Down

0 comments on commit b185e56

Please sign in to comment.