diff options
Diffstat (limited to 'cfrontend')
-rw-r--r-- | cfrontend/C2C.ml | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cfrontend/C2C.ml b/cfrontend/C2C.ml index f35598c7..1287a7ef 100644 --- a/cfrontend/C2C.ml +++ b/cfrontend/C2C.ml @@ -367,6 +367,10 @@ let first_class_value env ty = let is_volatile_access env e = List.mem C.AVolatile (Cutil.attributes_of_type env e.etyp) && Cutil.is_lvalue e + && begin match Cutil.unroll env e.etyp with + | TFun _ | TArray _ -> false + | _ -> true + end let volatile_kind ty = match ty with @@ -377,8 +381,7 @@ let volatile_kind ty = | Tint(I32, _) -> ("int32", Tint(I32, Signed), Mint32) | Tfloat F32 -> ("float32", ty, Mfloat32) | Tfloat F64 -> ("float64", ty, Mfloat64) - | Tpointer _ | Tarray _ | Tfunction _ | Tcomp_ptr _ -> - ("pointer", Tpointer Tvoid, Mint32) + | Tpointer _ -> ("pointer", Tpointer Tvoid, Mint32) | _ -> unsupported "operation on volatile struct or union"; ("", Tvoid, Mint32) |