Changeset 776 for src/Clight/Csem.ma


Ignore:
Timestamp:
Apr 27, 2011, 11:47:40 AM (9 years ago)
Author:
campbell
Message:

Fix up some minor null pointer issues in Clight.
Add corresponding Cminor example and fix up pretty printer a little.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Clight/Csem.ma

    r744 r776  
    139139      [ Vint n1 ⇒ match v2 with
    140140        [ Vptr r2 b2 p2 ofs2 ⇒ Some ? (Vptr r2 b2 p2 (shift_offset ofs2 (mul (repr (sizeof ty)) n1)))
     141        | Vnull r ⇒ if eq n1 zero then Some ? (Vnull r) else None ?
    141142        | _ ⇒ None ? ]
    142143      | _ ⇒ None ? ]
     
    162163      [ Vptr r1 b1 p1 ofs1 ⇒ match v2 with
    163164        [ Vint n2 ⇒ Some ? (Vptr r1 b1 p1 (neg_shift_offset ofs1 (mul (repr (sizeof ty)) n2)))
     165        | _ ⇒ None ? ]
     166      | Vnull r ⇒ match v2 with
     167        [ Vint n2 ⇒ if eq n2 zero then Some ? (Vnull r) else None ?
    164168        | _ ⇒ None ? ]
    165169      | _ ⇒ None ? ]
Note: See TracChangeset for help on using the changeset viewer.