From c6011e4386e7bb10a9bd272ff0c8cf40691abc65 Mon Sep 17 00:00:00 2001 From: AndreasHassing Date: Sat, 20 May 2017 13:24:23 +0200 Subject: [PATCH] Fix #3, undefined behaviour of get address of argument variables --- micro-wac/Wasmcomp.fs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/micro-wac/Wasmcomp.fs b/micro-wac/Wasmcomp.fs index 7c71262..cefde2b 100644 --- a/micro-wac/Wasmcomp.fs +++ b/micro-wac/Wasmcomp.fs @@ -186,10 +186,7 @@ let rec accessVar varEnv funEnv op = function @ [varAssOp false lv.Type lv.Offset] | ArgVar av -> match op with | GetValue -> [varAccOp true av.Type av.Id] - | GetAddr -> match av.Type with - | TypP _ -> [varAccOp true av.Type av.Id] - | TypA (typ, _) -> [varAccOp true typ av.Id] - | _ -> failwith (sprintf "can't get address of non-pointer function argument %A" av) + | GetAddr -> failwith (sprintf "can't get address of function arguments %A" av) | Set exp -> cExpr varEnv funEnv exp @ [varAssOp true av.Type av.Id] | GloVar gv -> I32_CONST gv.Addr :: match op with