diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2017-01-24 10:29:30 +0100 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2017-01-24 10:29:30 +0100 |
commit | d60b593c8b1d19a4adfdadaeeaa93aa10b9dba53 (patch) | |
tree | 838eef3aa4f09efd467971a51e6c76d49ebb8a59 /cparser/pre_parser.mly | |
parent | 47e818992372c1480b1052b64728a33d758637cf (diff) | |
download | compcert-d60b593c8b1d19a4adfdadaeeaa93aa10b9dba53.tar.gz compcert-d60b593c8b1d19a4adfdadaeeaa93aa10b9dba53.zip |
New version to support designators.
The c standard allows member designators for offsetof. The current
implementation works by recursively combining the offset of each
of the member designators. For array access the size of the
subtypes is multiplied by the index and for members the offset of
the member is calculated.
Bug 20765
Diffstat (limited to 'cparser/pre_parser.mly')
-rw-r--r-- | cparser/pre_parser.mly | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cparser/pre_parser.mly b/cparser/pre_parser.mly index 1c917b23..dc9c5319 100644 --- a/cparser/pre_parser.mly +++ b/cparser/pre_parser.mly @@ -254,7 +254,7 @@ postfix_expression: | postfix_expression LBRACK expression RBRACK | postfix_expression LPAREN argument_expression_list? RPAREN | BUILTIN_VA_ARG LPAREN assignment_expression COMMA type_name RPAREN -| BUILTIN_OFFSETOF LPAREN type_name COMMA other_identifier RPAREN +| BUILTIN_OFFSETOF LPAREN type_name COMMA designator_list RPAREN | postfix_expression DOT other_identifier | postfix_expression PTR other_identifier | postfix_expression INC |