diff options
author | Volker Reichelt <reichelt@igpm.rwth-aachen.de> | 2006-07-18 10:08:22 +0000 |
---|---|---|
committer | Volker Reichelt <reichelt@gcc.gnu.org> | 2006-07-18 10:08:22 +0000 |
commit | 12050e44231e61cf3cf595deb7b828e8fa197cd7 (patch) | |
tree | 3d17b916a205737a2d3169bbb5685b59b41c28ad /gcc/c-pragma.c | |
parent | e1cf56b1d989c6e50b4cd89b2956532588bd9881 (diff) | |
download | gcc-12050e44231e61cf3cf595deb7b828e8fa197cd7.zip gcc-12050e44231e61cf3cf595deb7b828e8fa197cd7.tar.gz gcc-12050e44231e61cf3cf595deb7b828e8fa197cd7.tar.bz2 |
re PR c/28286 (ICE with invalid value in #pragma pack)
PR c/28286
* c-pragma.c (handle_pragma_pack): Handle invalid constants.
* gcc.dg/pragma-pack-4.c: New test.
From-SVN: r115548
Diffstat (limited to 'gcc/c-pragma.c')
-rw-r--r-- | gcc/c-pragma.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c index e71ab07..b2712ac 100644 --- a/gcc/c-pragma.c +++ b/gcc/c-pragma.c @@ -160,6 +160,8 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy)) } else if (token == CPP_NUMBER) { + if (TREE_CODE (x) != INTEGER_CST) + GCC_BAD ("invalid constant in %<#pragma pack%> - ignored"); align = TREE_INT_CST_LOW (x); action = set; if (pragma_lex (&x) != CPP_CLOSE_PAREN) @@ -190,6 +192,8 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy)) } else if (token == CPP_NUMBER && action == push && align == -1) { + if (TREE_CODE (x) != INTEGER_CST) + GCC_BAD ("invalid constant in %<#pragma pack%> - ignored"); align = TREE_INT_CST_LOW (x); if (align == -1) action = set; |