summaryrefslogtreecommitdiff
path: root/cfrontend
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-07-07 08:41:55 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-07-07 08:41:55 +0000
commit39027a6ea0446b45d2c8aee1eb0c256a6f0f7417 (patch)
tree93523618b9674f8070170d1ffb4e40a639ee6608 /cfrontend
parenta0aaa3552d53b20a99566ac7116063fbb31b9964 (diff)
Bad printing of alignment on 'comm' symbols.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2291 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cfrontend')
-rw-r--r--cfrontend/CPragmas.ml8
1 files changed, 6 insertions, 2 deletions
diff --git a/cfrontend/CPragmas.ml b/cfrontend/CPragmas.ml
index 5ae147e..a31378e 100644
--- a/cfrontend/CPragmas.ml
+++ b/cfrontend/CPragmas.ml
@@ -37,9 +37,13 @@ let process_section_pragma classname istring ustring addrmode accmode =
(* #pragma use_section *)
+let re_c_ident = Str.regexp "[A-Za-z_][A-Za-z_0-9]*$"
+
let process_use_section_pragma classname id =
- if not (Sections.use_section_for (intern_string id) classname)
- then C2C.error (sprintf "unknown section name `%s'" classname)
+ if not (Str.string_match re_c_ident id 0) then
+ C2C.error (sprintf "bad identifier `%s' in #pragma use_section" id);
+ if not (Sections.use_section_for (intern_string id) classname) then
+ C2C.error (sprintf "unknown section name `%s'" classname)
(* #pragma reserve_register *)