diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2014-05-18 07:22:02 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2014-05-18 07:22:02 +0000 |
commit | 9cb3b2cd5ce322cecf9ef7c9b10296c6057b0ddb (patch) | |
tree | 091b320eaa924b880cd56da222a21b812d038f58 /cparser/Elab.ml | |
parent | 132541ce2fa2a910a4241da6955805c5734781f5 (diff) | |
download | compcert-9cb3b2cd5ce322cecf9ef7c9b10296c6057b0ddb.tar.gz compcert-9cb3b2cd5ce322cecf9ef7c9b10296c6057b0ddb.zip |
Another corner case for string literal initializers: char * x[] = { "lit" }
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2498 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cparser/Elab.ml')
-rw-r--r-- | cparser/Elab.ml | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cparser/Elab.ml b/cparser/Elab.ml index 34c545fd..7824bc3c 100644 --- a/cparser/Elab.ml +++ b/cparser/Elab.ml @@ -1601,7 +1601,8 @@ and elab_item zi item il = or wchar array = L"wide string literal" *) | (SINGLE_INIT (CONSTANT (CONST_STRING(w, s))) | COMPOUND_INIT [_, SINGLE_INIT(CONSTANT (CONST_STRING(w, s)))]), - TArray(ty_elt, sz, _) -> + TArray(ty_elt, sz, _) + when is_integer_type env ty_elt -> begin match elab_string_literal loc w s, unroll env ty_elt with | CStr s, TInt((IChar | ISChar | IUChar), _) -> if not (I.index_below (Int64.of_int(String.length s - 1)) sz) then |