diff options
Diffstat (limited to 'cfrontend/C2C.ml')
-rw-r--r-- | cfrontend/C2C.ml | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cfrontend/C2C.ml b/cfrontend/C2C.ml index a5a9fee1..9703e0b4 100644 --- a/cfrontend/C2C.ml +++ b/cfrontend/C2C.ml @@ -104,10 +104,11 @@ let name_for_string_literal env s = incr stringNum; let name = Printf.sprintf "__stringlit_%d" !stringNum in let id = intern_string name in + let sz = Int64.of_int (String.length s + 1) in Hashtbl.add decl_atom id { a_storage = C.Storage_static; a_env = env; - a_type = C.TPtr(C.TInt(C.IChar,[C.AConst]),[]); + a_type = C.TArray(C.TInt(C.IChar,[C.AConst]), Some sz, []); a_fundef = None }; Sections.define_stringlit id; Hashtbl.add stringTable s id; |