Ignore:
Timestamp:
Nov 28, 2011, 3:13:14 PM (8 years ago)
Author:
tranquil
Message:
  • corrected previous bug
  • finished propagating immediates
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D2.2/8051/src/RTL/RTLInterpret.ml

    r1568 r1572  
    9494  | RTL.Imm i -> Val.of_int i
    9595
    96 let get_arg_values lenv args = List.map (get_local_value lenv) args
     96let get_arg_values lenv args = List.map (get_local_arg_value lenv) args
    9797
    9898let get_local_addr lenv f1 f2 =
    99   List.map (get_local_value lenv) [f1 ; f2]
     99  List.map (get_local_arg_value lenv) [f1 ; f2]
    100100
    101101
     
    174174        let (v1, v2) =
    175175          Eval.opaccs opaccs
    176             (get_local_value lenv srcr1)
    177             (get_local_value lenv srcr2) in
     176            (get_local_arg_value lenv srcr1)
     177            (get_local_arg_value lenv srcr2) in
    178178        assign_state sfrs graph lbl sp lenv carry mem inds trace
    179179          [destr1 ; destr2] [v1 ; v2]
     
    186186        let (v, carry) =
    187187          Eval.op2 carry op2
    188             (get_local_value lenv srcr1)
     188            (get_local_arg_value lenv srcr1)
    189189            (get_local_arg_value lenv srcr2) in
    190190        assign_state sfrs graph lbl sp lenv carry mem inds trace [destr] [v]
     
    203203      | RTL.St_store (addr1, addr2, srcr, lbl) ->
    204204        let addr = get_local_addr lenv addr1 addr2 in
    205         let mem = Mem.store mem chunk addr (get_local_value lenv srcr) in
     205        let mem = Mem.store mem chunk addr (get_local_arg_value lenv srcr) in
    206206        State (sfrs, graph, lbl, sp, lenv, carry, mem, inds, trace)
    207207
     
    216216
    217217      | RTL.St_call_ptr (f1, f2, args, ret_regs, lbl) ->
    218         let addr = get_local_addr lenv f1 f2 in
     218        let addr = get_local_addr lenv (RTL.Reg f1) (RTL.Reg f2) in
    219219        let f_def = Mem.find_fun_def mem addr in
    220220        let args = get_arg_values lenv args in
     
    230230
    231231      | RTL.St_tailcall_ptr (f1, f2, args) ->
    232         let addr = get_local_addr lenv f1 f2 in
     232        let addr = get_local_addr lenv (RTL.Reg f1) (RTL.Reg f2) in
    233233        let f_def = Mem.find_fun_def mem addr in
    234234        let args = get_arg_values lenv args in
     
    241241
    242242      | RTL.St_return rl ->
    243         let vl = List.map (get_local_value lenv) rl in
     243        let vl = List.map (get_local_arg_value lenv) rl in
    244244        let mem = Mem.free mem sp in
    245245        ReturnState (sfrs, vl, mem, inds, trace)
Note: See TracChangeset for help on using the changeset viewer.