use lib functions

This commit is contained in:
Mylloon 2024-01-02 11:39:45 +01:00
parent cd8e36f7e4
commit f960f9c23b
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -563,14 +563,9 @@ module FrameManager (IS : InstructionSelector) : FrameManager = struct
let location_of fd id : T.address =
match S.IdMap.find_opt id fd.stack_map with
(* Si on retrouve id dans la stack map, alors c'est une variable locale *)
| Some o -> { offset = Some (Lit o); base = Some RBP; idx = None; scale = `One }
| Some o -> T.addr ~offset:(Lit o) ~base:RBP ()
(* Sinon, variable globale *)
| None ->
{ offset = Some (Lab (data_label_of_global id))
; base = Some RIP
; idx = None
; scale = `One
}
| None -> T.addr ~offset:(Lab (data_label_of_global id)) ~base:RIP ()
;;
let function_prologue fd =